mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-24 18:06:42 +02:00
CLI
- Tags the binary basename as either TW or CALENDAR.
This commit is contained in:
parent
6dea38806b
commit
8cb287ec69
1 changed files with 13 additions and 0 deletions
13
src/CLI.cpp
13
src/CLI.cpp
|
@ -277,6 +277,19 @@ void CLI::analyze ()
|
|||
A a ("arg", _original_args[i]);
|
||||
a.tag ("ORIGINAL");
|
||||
a.tag ("BINARY");
|
||||
|
||||
std::string basename = "task";
|
||||
std::string raw = _original_args[i];
|
||||
std::string::size_type slash = raw.rfind ('/');
|
||||
if (slash != std::string::npos)
|
||||
basename = raw.substr (slash + 1);
|
||||
|
||||
a.attribute ("basename", basename);
|
||||
if (basename == "cal" || basename == "calendar")
|
||||
a.tag ("CALENDAR");
|
||||
else if (basename == "task" || basename == "tw" || basename == "t")
|
||||
a.tag ("TW");
|
||||
|
||||
_args.push_back (a);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue