1 /* commonhelp.cc: handle command line help common to omindex and scriptindex
3 * Copyright (C) 2005,2006,2008,2009,2010,2013 Olly Betts
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 #include "commonhelp.h"
33 void print_package_info(const char *name
) {
34 cout
<< name
<< " - " PACKAGE_STRING
<< endl
;
37 void print_stemmer_help(const char * spaces
) {
38 cout
<< " -s, --stemmer=LANG " << spaces
<< "set the stemming language (default: english).\n";
39 string wrap
= "Possible values: " + Xapian::Stem::get_available_languages();
40 wrap
+= " (pass 'none' to disable stemming)";
41 const size_t WRAP_AT
= 79 - 22 - strlen(spaces
);
42 while (wrap
.size() > WRAP_AT
) {
44 for (i
= WRAP_AT
; i
> 0 && wrap
[i
] != ' '; --i
) { }
46 cout
<< string(22, ' ') << spaces
<< wrap
.substr(0, i
) << "\n";
49 cout
<< string(22, ' ') << spaces
<< wrap
<< endl
;
52 void print_help_and_version_help(const char * spaces
) {
53 cout
<< " -h, --help " << spaces
<< "display this help and exit\n"
54 " -V, --version " << spaces
<< "output version information and exit\n"
56 "Please report bugs at:\n"
57 PACKAGE_BUGREPORT
<< endl
;