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