Keep -? as usage.

pull/2873/head
nicm 2021-09-09 21:55:03 +00:00
parent a0b39dba31
commit 768fb9080f
2 changed files with 5 additions and 1 deletions

View File

@ -153,6 +153,10 @@ args_parse(const struct args_parse *parse, struct args_value *values,
flag = *string++;
if (flag == '\0')
break;
if (flag == '?') {
args_free(args);
return (NULL);
}
if (!isalnum(flag)) {
xasprintf(cause, "invalid flag -%c", flag);
args_free(args);

2
cmd.c
View File

@ -502,7 +502,7 @@ cmd_parse(struct args_value *values, u_int count, const char *file, u_int line,
const struct cmd_entry *entry;
struct cmd *cmd;
struct args *args;
char *error;
char *error = NULL;
if (count == 0 || values[0].type != ARGS_STRING) {
xasprintf(cause, "no command");