Enhancement - custom report name collisions

- Task now emits an error if a custom report name collides with
  that of a built-in command.
This commit is contained in:
Paul Beckingham 2009-06-18 20:13:12 -04:00
parent aeaf443f67
commit 315c70c503
2 changed files with 69 additions and 64 deletions

View file

@ -147,9 +147,14 @@ void Cmd::load ()
{
report = report.substr (0, columns);
// Make sure a custom report does not clash with a built-in
// command.
if (std::find (commands.begin (), commands.end (), report) != commands.end ())
throw std::string ("Custom report '") + report +
"' conflicts with built-in task command.";
// A custom report is also a command.
// TODO Make sure a custom report does not clash with a built-in
// command.
customReports.push_back (report);
commands.push_back (report);
}