1 /* helptext.c - English help texts
2 * Copyright (C) 1998, 1999, 2000, 2001, 2002,
3 * 2004, 2007 Free Software Foundation, Inc.
5 * This file is part of GnuPG.
7 * GnuPG is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * GnuPG is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <http://www.gnu.org/licenses/>.
35 /* Helper to get the help through the configurable GnuPG help
38 get_help_from_file (const char *keyword
)
42 key
= xtrymalloc (4 + strlen (keyword
) + 1);
45 strcpy (stpcpy (key
, "gpg."), keyword
);
46 result
= gnupg_get_help_string (key
, 0);
48 if (result
&& !is_native_utf8 ())
50 char *tmp
= utf8_to_native (result
, strlen (result
), -1);
65 display_online_help( const char *keyword
)
68 int need_final_lf
= 1;
72 tty_printf (_("No help available") );
73 else if ( (result
= get_help_from_file (keyword
)) )
75 tty_printf ("%s", result
);
76 if (*result
&& result
[strlen (result
)-1] == '\n')
82 tty_printf (_("No help available for `%s'"), keyword
);