diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/stdlib/cli.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/stdlib/cli.c b/src/stdlib/cli.c index 47cac2e1..22ed9b94 100644 --- a/src/stdlib/cli.c +++ b/src/stdlib/cli.c @@ -198,10 +198,12 @@ static List_t parse_arg_list(List_t args, const char *flag, void *dest, const Ty const char *arg = *(const char **)args.data; - if ((type->tag == TextInfo || type == &CString$info) && arg[0] == '\\' && arg[1] == '-') { - arg = arg + 1; - } else if (arg[0] == '-' && !allow_dashes) { - print_err("Not a valid argument for flag ", flag, ": ", arg); + if (!allow_dashes) { + if ((type->tag == TextInfo || type == &CString$info) && arg[0] == '\\' && arg[1] == '-') { + arg = arg + 1; + } else if (arg[0] == '-') { + print_err("Not a valid argument for flag ", flag, ": ", arg); + } } if (type->tag == OptionalInfo) { |
