diff options
author | Werner Koch <[email protected]> | 2020-02-21 19:28:47 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-02-21 19:28:47 +0000 |
commit | 3bc004decd289810bc1b6ad6fb8f47e45c770ce6 (patch) | |
tree | f6e161cc838bfaacbfc647ff5f68ed04d977105f /tools/gpg-pair-tool.c | |
parent | Use gpgrt's new option parser for gpgc, gpgsm, and gpg-agent. (diff) | |
download | gnupg-3bc004decd289810bc1b6ad6fb8f47e45c770ce6.tar.gz gnupg-3bc004decd289810bc1b6ad6fb8f47e45c770ce6.zip |
Use gpgrt's new option parser for the tools.
* agent/preset-passphrase.c: Switch to the new option parser.
* agent/protect-tool.c: Ditto.
* kbx/kbxutil.c: Ditto.
* tools/gpg-card.c: Ditto.
* tools/gpg-check-pattern.c: Ditto.
* tools/gpg-connect-agent.c: Ditto.
* tools/gpg-pair-tool.c: Ditto.
* tools/gpg-wks-client.c: Ditto.
* tools/gpg-wks-server.c: Ditto.
* tools/gpgconf.c: Ditto.
* tools/gpgsplit.c: Ditto.
* tools/gpgtar.c: Ditto.
--
This is another part of changes. A followup patch will address the
remaining daemons.
GnuPG-bug-id: 4788
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/gpg-pair-tool.c')
-rw-r--r-- | tools/gpg-pair-tool.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/gpg-pair-tool.c b/tools/gpg-pair-tool.c index a41d99031..25fa074c8 100644 --- a/tools/gpg-pair-tool.c +++ b/tools/gpg-pair-tool.c @@ -15,6 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, see <https://www.gnu.org/licenses/>. + * SPDX-License-Identifier: LGPL-2.1-or-later */ /* Protocol: @@ -120,9 +121,7 @@ */ #include <config.h> -/* We don't want to have the macros from gpgrt here until we have - * completely replaced this module by the one from gpgrt. */ -#undef GPGRT_ENABLE_ARGPARSE_MACROS + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -138,8 +137,6 @@ #include "../common/sysutils.h" #include "../common/init.h" #include "../common/name-value.h" -#include "../common/argparse.h" /* temporary hack. */ - /* Constants to identify the commands and options. */ enum cmd_and_opt_values @@ -292,7 +289,8 @@ my_strusage( int level ) static void wrong_args (const char *text) { - es_fprintf (es_stderr, _("usage: %s [options] %s\n"), strusage (11), text); + es_fprintf (es_stderr, _("usage: %s [options] %s\n"), + gpgrt_strusage (11), text); exit (2); } @@ -416,6 +414,7 @@ main (int argc, char **argv) default: pargs.err = ARGPARSE_PRINT_WARNING; break; } } + gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */ /* Print a warning if an argument looks like an option. */ if (!opt.quiet && !(pargs.flags & ARGPARSE_FLAG_STOP_SEEN)) |