mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Merge branch '212-fix-help-handling' of git://github.com/sruffell/timewarrior into sruffell-212-fix-help-handling
This commit is contained in:
commit
6bb4f981cb
2 changed files with 24 additions and 3 deletions
17
src/CLI.cpp
17
src/CLI.cpp
|
@ -445,6 +445,23 @@ void CLI::canonicalizeNames ()
|
|||
alreadyFoundCmd = true;
|
||||
}
|
||||
|
||||
// 'timew <command> --help' should be treated the same as 'timew help
|
||||
// <command>'. Therefore, "--help" on the command line should always
|
||||
// become the command.
|
||||
else if (alreadyFoundCmd && (raw == "--help"))
|
||||
{
|
||||
for (auto& b : _args) {
|
||||
if (b.hasTag("CMD"))
|
||||
{
|
||||
b.unTag("CMD");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
a.tag ("CMD");
|
||||
a.attribute("canonical", canonical);
|
||||
}
|
||||
|
||||
// Hints.
|
||||
else if (exactMatch ("hint", raw) ||
|
||||
canonicalize (canonical, "hint", raw))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue