[PATCH] distinguish between ARGPARSE_AMBIGUOUS_{OPTION,COMMAND}

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Nov 21 23:04:42 CET 2014


This avoids a dead path in the argparse code.

It's not clear that this is needed, however, since
ARGPARSE_AMBIGUOUS_COMMAND is never actually used in the code.
Another approach would be to trim out ARGPARSE_AMBIGUOUS_COMMAND
entirely.
---
 common/argparse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/argparse.c b/common/argparse.c
index 0a36a9e..169e234 100644
--- a/common/argparse.c
+++ b/common/argparse.c
@@ -290,7 +290,7 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
             jnlib_log_error (_("invalid command \"%.50s\"\n"), s);
           else if ( arg->r_opt == ARGPARSE_AMBIGUOUS_OPTION )
             jnlib_log_error (_("option \"%.50s\" is ambiguous\n"), s);
-          else if ( arg->r_opt == ARGPARSE_AMBIGUOUS_OPTION )
+          else if ( arg->r_opt == ARGPARSE_AMBIGUOUS_COMMAND )
             jnlib_log_error (_("command \"%.50s\" is ambiguous\n"),s );
           else if ( arg->r_opt == ARGPARSE_OUT_OF_CORE )
             jnlib_log_error ("%s\n", _("out of core\n"));
-- 
2.1.3




More information about the Gnupg-devel mailing list