diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-23 15:42:20 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-23 15:42:20 -0400 |
commit | 371fc62eece5ad75b41f5377d955ed3b946d1e7d (patch) | |
tree | 89d516c9b47559ec3d4df70083e1f6735bb1c5ed /src/interactive.cc | |
parent | 17fe4b752c6fc8bbc7920fa34c2515925a8f2515 (diff) | |
download | ledger-371fc62eece5ad75b41f5377d955ed3b946d1e7d.tar.gz ledger-371fc62eece5ad75b41f5377d955ed3b946d1e7d.tar.bz2 ledger-371fc62eece5ad75b41f5377d955ed3b946d1e7d.zip |
If interactive_t wants S, also accept bare values
Diffstat (limited to 'src/interactive.cc')
-rw-r--r-- | src/interactive.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interactive.cc b/src/interactive.cc index eeb9b53f..9bb10c07 100644 --- a/src/interactive.cc +++ b/src/interactive.cc @@ -58,6 +58,8 @@ void interactive_t::verify_arguments() const } for (; ! wrong_arg && ! exit_loop && *p && next_arg; p++) { + DEBUG("interactive.verify", + "Want " << *p << " got: " << next_arg->label()); switch (*p) { case 'a': label = "an amount"; @@ -117,7 +119,7 @@ void interactive_t::verify_arguments() const break; case 'S': label = "a sequence"; - wrong_arg = ! next_arg->is_sequence(); + wrong_arg = false; break; case '&': optional = true; @@ -151,6 +153,8 @@ void interactive_t::verify_arguments() const if (*p == '&' || *p == '*') optional = true; + DEBUG("interactive.verify", "Remaining args are optional"); + if (wrong_arg) { throw_(std::logic_error, "Expected " << label << " for argument " << offset |