diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-08-26 13:38:50 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-08-26 13:38:50 +0200 |
commit | 53389e24b688f8eb4e63db4714cf1d00916d603a (patch) | |
tree | 3f4090d56028f297b26dd503f4880a2a2e8f66e1 /src | |
parent | c fix (diff) | |
download | argparser-53389e24b688f8eb4e63db4714cf1d00916d603a.tar.gz argparser-53389e24b688f8eb4e63db4714cf1d00916d603a.tar.bz2 argparser-53389e24b688f8eb4e63db4714cf1d00916d603a.tar.xz |
c fix
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/argparser.c | 18 | ||||
-rw-r--r-- | src/argparser.h | 8 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/argparser.c b/src/argparser.c index 28670e3..644f6fd 100644 --- a/src/argparser.c +++ b/src/argparser.c @@ -750,6 +750,18 @@ void args_optmap_trigger(char* name, char* value) } /** + * Trigger an option + * + * @param name The option's alternative name + * @param value The use value + */ +void args_optmap_triggerv(char* name, char* value) +{ + args_Option* opt = args_options + args_optmap_get_index(name); + opt->triggerv(name, opt->standard, value); +} + +/** * Evaluate if an argument can be used without being sticky for an optionally argument option * * @param name The option's alternative name @@ -1333,10 +1345,10 @@ long args_parse(int argc, char** argv) char* arg_opt = *(optqueue + optptr - get--); long passed = true; if (args_optmap_get_type(arg_opt) == OPTARGUMENTED) - if (args_optmap_stickless(arg_opt, arg)) + if (args_optmap_stickless(arg_opt, arg) == false) { passed = false; - args_optmap_trigger(arg_opt, null); + args_optmap_triggerv(arg_opt, null); *(argqueue + argptr++) = null; } if (passed) @@ -1487,7 +1499,7 @@ long args_parse(int argc, char** argv) char* opt = args_optmap_get_standard(*(optqueue + i)); char* arg = argptr > i ? *(argqueue + i) : null; if (argptr <= i) - args_optmap_trigger(opt, null); + args_optmap_triggerv(opt, null); i++; if ((args_optmap_contains(opt) == false) || (args_opts_contains(opt) == false)) args_opts_new(opt); diff --git a/src/argparser.h b/src/argparser.h index 7cc82b2..3c06584 100644 --- a/src/argparser.h +++ b/src/argparser.h @@ -330,6 +330,14 @@ extern char* args_options_get_standard(long index); void args_optmap_trigger(char* name, char* value); /** + * Trigger an option + * + * @param name The option's alternative name + * @param value The use value + */ +void args_optmap_triggerv(char* name, char* value); + +/** * Evaluate if an argument can be used without being sticky for an optionally argument option * * @param name The option's alternative name |