mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-04 12:28:35 +02:00
Commands
- Implemented CmdHelp object that replaces the report.cpp longUsage function, and builds the output dynamically from other Command objects. This is also why the help text right now is very short, as only a few commands are migrated. - Obsoleted longUsage function. - Updated task.1 man page with 'execute' command details. - Modified command.lua sample to include command usage. - Removed "help" from old Context::dispatch, which means "help" is the first migrated command. - Added usage and description to all Cmd* objects. - Implemented Command::usage and Command::description as base class methods that simply return data that is specified by the derived classes.
This commit is contained in:
parent
afc97d566c
commit
bc756637da
15 changed files with 477 additions and 91 deletions
|
@ -285,84 +285,6 @@ int shortUsage (std::string& outs)
|
|||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int longUsage (std::string& outs)
|
||||
{
|
||||
int rc = 0;
|
||||
std::string shortUsageString;
|
||||
std::stringstream out;
|
||||
|
||||
(void)shortUsage(shortUsageString);
|
||||
|
||||
out << shortUsageString
|
||||
<< "ID is the numeric identifier displayed by the 'task list' command. "
|
||||
<< "You can specify multiple IDs for task commands, and multiple tasks "
|
||||
<< "will be affected. To specify multiple IDs make sure you use one "
|
||||
<< "of these forms:" << "\n"
|
||||
<< " task delete 1,2,3" << "\n"
|
||||
<< " task info 1-3" << "\n"
|
||||
<< " task pri:H 1,2-5,19" << "\n"
|
||||
<< "\n"
|
||||
<< "Tags are arbitrary words, any quantity:" << "\n"
|
||||
<< " +tag The + means add the tag" << "\n"
|
||||
<< " -tag The - means remove the tag" << "\n"
|
||||
<< "\n"
|
||||
<< "Attributes are:" << "\n"
|
||||
<< " project: Project name" << "\n"
|
||||
<< " priority: Priority" << "\n"
|
||||
<< " due: Due date" << "\n"
|
||||
<< " recur: Recurrence frequency" << "\n"
|
||||
<< " until: Recurrence end date" << "\n"
|
||||
<< " fg: Foreground color" << "\n"
|
||||
<< " bg: Background color" << "\n"
|
||||
<< " limit: Desired number of rows in report, or 'page'" << "\n"
|
||||
<< " wait: Date until task becomes pending" << "\n"
|
||||
<< "\n"
|
||||
<< "Attribute modifiers improve filters. Supported modifiers are:" << "\n"
|
||||
<< " before (synonyms under, below)" << "\n"
|
||||
<< " after (synonyms over, above)" << "\n"
|
||||
<< " none" << "\n"
|
||||
<< " any" << "\n"
|
||||
<< " is (synonym equals)" << "\n"
|
||||
<< " isnt (synonym not)" << "\n"
|
||||
<< " has (synonym contains)" << "\n"
|
||||
<< " hasnt" << "\n"
|
||||
<< " startswith (synonym left)" << "\n"
|
||||
<< " endswith (synonym right)" << "\n"
|
||||
<< " word" << "\n"
|
||||
<< " noword" << "\n"
|
||||
<< "\n"
|
||||
<< " For example:" << "\n"
|
||||
<< " task list due.before:eom priority.not:L" << "\n"
|
||||
<< "\n"
|
||||
<< " Modifiers can be inverted with the ~ character:" << "\n"
|
||||
<< " project.~is is equivalent to project.isnt" << "\n"
|
||||
<< "\n"
|
||||
<< "The default .taskrc file can be overridden with:" << "\n"
|
||||
<< " task rc:<alternate file> ..." << "\n"
|
||||
<< "\n"
|
||||
<< "The values in .taskrc (or alternate) can be overridden with:" << "\n"
|
||||
<< " task ... rc.<name>:<value>" << "\n"
|
||||
<< "\n"
|
||||
<< "Any command or attribute name may be abbreviated if still unique:" << "\n"
|
||||
<< " task list project:Home" << "\n"
|
||||
<< " task li pro:Home" << "\n"
|
||||
<< "\n"
|
||||
<< "Some task descriptions need to be escaped because of the shell:" << "\n"
|
||||
<< " task add \"quoted ' quote\"" << "\n"
|
||||
<< " task add escaped \\' quote" << "\n"
|
||||
<< "\n"
|
||||
<< "The argument -- tells taskwarrior to treat all other args as description." << "\n"
|
||||
<< " task add -- project:Home needs scheduling" << "\n"
|
||||
<< "\n"
|
||||
<< "Many characters have special meaning to the shell, including:" << "\n"
|
||||
<< " $ ! ' \" ( ) ; \\ ` * ? { } [ ] < > | & % # ~" << "\n"
|
||||
<< "\n";
|
||||
|
||||
outs = out.str();
|
||||
return rc;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Display all information for the given task.
|
||||
int handleInfo (std::string& outs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue