aboutsummaryrefslogtreecommitdiffstats
path: root/util/argparse.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-11-27 14:33:31 +0000
committerWerner Koch <[email protected]>1998-11-27 14:33:31 +0000
commitd87a3c14c47e16bba135c2af948b00670fea8c30 (patch)
tree88d70f1ffab768ca109078faa5c6037c55f6bf28 /util/argparse.c
parentSee ChangeLog: Fri Nov 27 12:39:29 CET 1998 Werner Koch (diff)
downloadgnupg-d87a3c14c47e16bba135c2af948b00670fea8c30.tar.gz
gnupg-d87a3c14c47e16bba135c2af948b00670fea8c30.zip
See ChangeLog: Fri Nov 27 15:30:24 CET 1998 Werner Koch
Diffstat (limited to 'util/argparse.c')
-rw-r--r--util/argparse.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/util/argparse.c b/util/argparse.c
index 29870e977..ffda57238 100644
--- a/util/argparse.c
+++ b/util/argparse.c
@@ -148,6 +148,7 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
arg->internal.inarg = 0;
arg->internal.stopped = 0;
arg->internal.aliases = NULL;
+ arg->internal.cur_alias = NULL;
arg->err = 0;
arg->flags |= 1<<15; /* mark initialized */
if( *arg->argc < 0 )
@@ -401,7 +402,6 @@ find_long_option( ARGPARSE_ARGS *arg,
{
int i;
size_t n;
- ALIAS_DEF a;
/* Would be better if we can do a binary search, but it is not
possible to reorder our option table because we would mess
@@ -412,12 +412,19 @@ find_long_option( ARGPARSE_ARGS *arg,
for(i=0; opts[i].short_opt; i++ )
if( opts[i].long_opt && !strcmp( opts[i].long_opt, keyword) )
return i;
- #if 0
- /* see whether it is an alias */
- for( a= argds->internal.aliases; a; a = a->next )
- if( !strcmp( a->name, keyword) )
- return what_do_we_return_here;
- #endif
+ #if 0
+ {
+ ALIAS_DEF a;
+ /* see whether it is an alias */
+ for( a = args->internal.aliases; a; a = a->next ) {
+ if( !strcmp( a->name, keyword) ) {
+ /* fixme: must parse the alias here */
+ args->internal.cur_alias = a;
+ return -3; /* alias available */
+ }
+ }
+ }
+ #endif
/* not found, see whether it is an abbreviation */
/* aliases may not be abbreviated */
n = strlen( keyword );