Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/CLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,18 @@ void CLI::canonicalizeNames ()
}

// Hints.
else if (exactMatch ("hint", raw) ||
canonicalize (canonical, "hint", raw))
else if (0 == raw.compare (0, 1, ":"))
{
a.attribute ("canonical", canonical);
a.tag ("HINT");
if (exactMatch ("hint", raw) ||
canonicalize (canonical, "hint", raw))
{
a.attribute ("canonical", canonical);
a.tag ("HINT");
}
else
{
throw format ("Unknown hint '{1}'", raw);
}
}

// Extensions.
Expand Down
5 changes: 5 additions & 0 deletions test/cli.t
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ class TestCLI(TestCase):
code, out, err = self.t.runError("bogus")
self.assertIn("'bogus' is not a timew command. See 'timew help'.", err)

def test_TimeWarrior_with_invalid_hint(self):
"""Call a non-existing TimeWarrior hint should be an error"""
code, out, err = self.t.runError(":invalid_hint")
self.assertIn("':invalid_hint'", err)


if __name__ == "__main__":
from simpletap import TAPTestRunner
Expand Down