If interactive_t wants S, also accept bare values
This commit is contained in:
parent
17fe4b752c
commit
371fc62eec
1 changed files with 5 additions and 1 deletions
|
|
@ -58,6 +58,8 @@ void interactive_t::verify_arguments() const
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; ! wrong_arg && ! exit_loop && *p && next_arg; p++) {
|
for (; ! wrong_arg && ! exit_loop && *p && next_arg; p++) {
|
||||||
|
DEBUG("interactive.verify",
|
||||||
|
"Want " << *p << " got: " << next_arg->label());
|
||||||
switch (*p) {
|
switch (*p) {
|
||||||
case 'a':
|
case 'a':
|
||||||
label = "an amount";
|
label = "an amount";
|
||||||
|
|
@ -117,7 +119,7 @@ void interactive_t::verify_arguments() const
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
label = "a sequence";
|
label = "a sequence";
|
||||||
wrong_arg = ! next_arg->is_sequence();
|
wrong_arg = false;
|
||||||
break;
|
break;
|
||||||
case '&':
|
case '&':
|
||||||
optional = true;
|
optional = true;
|
||||||
|
|
@ -151,6 +153,8 @@ void interactive_t::verify_arguments() const
|
||||||
if (*p == '&' || *p == '*')
|
if (*p == '&' || *p == '*')
|
||||||
optional = true;
|
optional = true;
|
||||||
|
|
||||||
|
DEBUG("interactive.verify", "Remaining args are optional");
|
||||||
|
|
||||||
if (wrong_arg) {
|
if (wrong_arg) {
|
||||||
throw_(std::logic_error,
|
throw_(std::logic_error,
|
||||||
"Expected " << label << " for argument " << offset
|
"Expected " << label << " for argument " << offset
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue