mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Commands
- Eliminated the Command::implements method. - Implemented CmdCustom to handle all custom reports. - Implemented CmdTags.
This commit is contained in:
parent
31e865e823
commit
bedc28f517
18 changed files with 575 additions and 129 deletions
|
@ -43,20 +43,6 @@ CmdHelp::CmdHelp ()
|
|||
_displays_id = false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool CmdHelp::implements (const std::string& command_line)
|
||||
{
|
||||
if (context.args.size () &&
|
||||
(context.args[0] == "help" ||
|
||||
context.args[0] == "hel" ||
|
||||
context.args[0] == "he"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdHelp::execute (const std::string& command_line, std::string& output)
|
||||
{
|
||||
|
@ -77,7 +63,7 @@ int CmdHelp::execute (const std::string& command_line, std::string& output)
|
|||
for (i = context.commands.begin (); i != context.commands.end (); ++i)
|
||||
all.push_back (i->first);
|
||||
|
||||
// Sort alphabetically.
|
||||
// Sort alphabetically by usage.
|
||||
std::sort (all.begin (), all.end ());
|
||||
|
||||
foreach (name, all)
|
||||
|
@ -167,10 +153,6 @@ int CmdHelp::execute (const std::string& command_line, std::string& output)
|
|||
view.set (row, 1, "task projects");
|
||||
view.set (row, 2, "Shows a list of all project names used, and how many tasks are in each.");
|
||||
|
||||
row = view.addRow ();
|
||||
view.set (row, 1, "task tags");
|
||||
view.set (row, 2, "Shows a list of all tags used.");
|
||||
|
||||
row = view.addRow ();
|
||||
view.set (row, 1, "task summary");
|
||||
view.set (row, 2, "Shows a report of task status by project.");
|
||||
|
@ -275,27 +257,6 @@ int CmdHelp::execute (const std::string& command_line, std::string& output)
|
|||
row = view.addRow ();
|
||||
view.set (row, 1, "task diagnostics");
|
||||
view.set (row, 2, "Information needed when reporting a problem.");
|
||||
|
||||
row = view.addRow ();
|
||||
view.set (row, 1, "task help");
|
||||
view.set (row, 2, "Shows the long usage text.");
|
||||
*/
|
||||
|
||||
/*
|
||||
// TODO Add custom reports here...
|
||||
std::vector <std::string> all;
|
||||
context.cmd.allCustomReports (all);
|
||||
foreach (report, all)
|
||||
{
|
||||
std::string command = std::string ("task ") + *report + std::string (" [tags] [attrs] desc...");
|
||||
std::string description = context.config.get (std::string ("report.") + *report + ".description");
|
||||
if (description == "")
|
||||
description = "(missing description)";
|
||||
|
||||
row = view.addRow ();
|
||||
view.set (row, 1, command);
|
||||
view.set (row, 2, description);
|
||||
}
|
||||
*/
|
||||
|
||||
output = "\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue