TI-62: TimeWarrior should not ignore invalid command

- Rule: If there is no command found, the command line has to be empty.
  Otherwise we assume a mistyped or unknown command has been issued.
  Take the first word from the command line and complain about it.
This commit is contained in:
Thomas Lauf 2017-04-11 07:10:43 +02:00
parent 01a3c8e3f6
commit 7244259740
2 changed files with 11 additions and 1 deletions

View file

@ -34,6 +34,7 @@
(thanks to Lynoure, asmyers). (thanks to Lynoure, asmyers).
- TI-61 Typo in exclusion.t.cpp - TI-61 Typo in exclusion.t.cpp
(thanks to Thomas Lauf). (thanks to Thomas Lauf).
- TI-62 TimeWarrior should not ignore invalid command
- TI-64 Command 'stop' with date before current interval's start date causes segfault - TI-64 Command 'stop' with date before current interval's start date causes segfault
(thanks to Thomas Lauf). (thanks to Thomas Lauf).
- TI-65 The 'tags' command should support a filter - TI-65 The 'tags' command should support a filter

View file

@ -297,7 +297,16 @@ int dispatchCommand (
} }
else else
{ {
status = CmdDefault (rules, database); auto words = cli.getWords ();
if (words.size () > 0)
{
throw format ("'{1}' is not a timew command. See 'timew help'.", words[0]);
}
else
{
status = CmdDefault (rules, database);
}
} }
return status; return status;