mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Enhancement - _config
- Merged Fredde's _config command with prior bug fix.
This commit is contained in:
parent
e2da1d0a9a
commit
8bf0f1176b
4 changed files with 18 additions and 0 deletions
|
@ -109,6 +109,7 @@ void Cmd::load ()
|
|||
commands.push_back ("_tags");
|
||||
commands.push_back ("_commands");
|
||||
commands.push_back ("_ids");
|
||||
commands.push_back ("_config");
|
||||
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"));
|
||||
|
@ -189,6 +190,7 @@ bool Cmd::isReadOnlyCommand ()
|
|||
command == "_tags" ||
|
||||
command == "_commands" ||
|
||||
command == "_ids" ||
|
||||
command == "_config" ||
|
||||
command == context.stringtable.get (CMD_CALENDAR, "calendar") ||
|
||||
command == context.stringtable.get (CMD_COLORS, "colors") ||
|
||||
command == context.stringtable.get (CMD_EXPORT, "export") ||
|
||||
|
|
|
@ -202,6 +202,7 @@ std::string Context::dispatch ()
|
|||
else if (cmd.command == "_tags") { out = handleCompletionTags (); }
|
||||
else if (cmd.command == "_commands") { out = handleCompletionCommands (); }
|
||||
else if (cmd.command == "_ids") { out = handleCompletionIDs (); }
|
||||
else if (cmd.command == "_config") { out = handleCompletionConfig (); }
|
||||
else if (cmd.command == "" &&
|
||||
sequence.size ()) { out = handleModify (); }
|
||||
|
||||
|
|
|
@ -330,6 +330,20 @@ std::string handleCompletionCommands ()
|
|||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string handleCompletionConfig ()
|
||||
{
|
||||
std::vector <std::string> configs;
|
||||
context.config.all (configs);
|
||||
std::sort (configs.begin (), configs.end ());
|
||||
|
||||
std::stringstream out;
|
||||
foreach (config, configs)
|
||||
out << *config << std::endl;
|
||||
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string handleCompletionIDs ()
|
||||
{
|
||||
|
|
|
@ -66,6 +66,7 @@ std::string handleTags ();
|
|||
std::string handleCompletionTags ();
|
||||
std::string handleCompletionCommands ();
|
||||
std::string handleCompletionIDs ();
|
||||
std::string handleCompletionConfig ();
|
||||
std::string handleVersion ();
|
||||
std::string handleDelete ();
|
||||
std::string handleStart ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue