mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 22:47:20 +02:00
Enhancement - _commands
- Added undocumented _commands command to support completion scripts.
This commit is contained in:
parent
a6e9e6cdfb
commit
f633e42597
5 changed files with 28 additions and 0 deletions
11
src/Cmd.cpp
11
src/Cmd.cpp
|
@ -108,6 +108,7 @@ void Cmd::load ()
|
|||
{
|
||||
commands.push_back ("_projects");
|
||||
commands.push_back ("_tags");
|
||||
commands.push_back ("_commands");
|
||||
commands.push_back (context.stringtable.get (CMD_ADD, "add"));
|
||||
commands.push_back (context.stringtable.get (CMD_APPEND, "append"));
|
||||
commands.push_back (context.stringtable.get (CMD_ANNOTATE, "annotate"));
|
||||
|
@ -180,12 +181,22 @@ void Cmd::allCustomReports (std::vector <std::string>& all) const
|
|||
all = customReports;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Cmd::allCommands (std::vector <std::string>& all) const
|
||||
{
|
||||
all.clear ();
|
||||
foreach (command, commands)
|
||||
if (command->substr (0, 1) != "_")
|
||||
all.push_back (*command);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Commands that do not directly modify the data files.
|
||||
bool Cmd::isReadOnlyCommand ()
|
||||
{
|
||||
if (command == "_projects" ||
|
||||
command == "_tags" ||
|
||||
command == "_commands" ||
|
||||
command == context.stringtable.get (CMD_CALENDAR, "calendar") ||
|
||||
command == context.stringtable.get (CMD_COLORS, "colors") ||
|
||||
command == context.stringtable.get (CMD_EXPORT, "export") ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue