mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
I18N
- Localized and updated the 'help' command.
This commit is contained in:
parent
2826f1918e
commit
66ca9add3a
2 changed files with 118 additions and 84 deletions
|
@ -25,10 +25,14 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define L10N // Localization complete.
|
||||
|
||||
#include <algorithm>
|
||||
#include <CmdHelp.h>
|
||||
#include <ViewText.h>
|
||||
#include <Context.h>
|
||||
#include <i18n.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
|
||||
extern Context context;
|
||||
|
@ -38,7 +42,7 @@ CmdHelp::CmdHelp ()
|
|||
{
|
||||
_keyword = "help";
|
||||
_usage = "task help";
|
||||
_description = "Displays this usage help text";
|
||||
_description = STRING_CMD_HELP_USAGE;
|
||||
_read_only = true;
|
||||
_displays_id = false;
|
||||
}
|
||||
|
@ -54,9 +58,9 @@ int CmdHelp::execute (std::string& output)
|
|||
|
||||
// Static first row.
|
||||
int row = view.addRow ();
|
||||
view.set (row, 0, "Usage:");
|
||||
view.set (row, 0, STRING_CMD_HELP_USAGE_LABEL);
|
||||
view.set (row, 1, "task");
|
||||
view.set (row, 2, "Runs rc.default.command, if specified.");
|
||||
view.set (row, 2, STRING_CMD_HELP_USAGE_DESC);
|
||||
|
||||
// Obsolete method of getting a list of all commands.
|
||||
std::vector <std::string> all;
|
||||
|
@ -101,89 +105,13 @@ int CmdHelp::execute (std::string& output)
|
|||
{
|
||||
row = view.addRow ();
|
||||
view.set (row, 1, alias->first);
|
||||
view.set (row, 2, "Aliased to '" + alias->second + "'");
|
||||
view.set (row, 2, format (STRING_CMD_HELP_ALIASED, alias->second));
|
||||
}
|
||||
|
||||
output = "\n"
|
||||
+ view.render ()
|
||||
+ "\n"
|
||||
+ "Documentation for taskwarrior can be found using 'man task', "
|
||||
"'man taskrc', 'man task-tutorial', 'man task-color', 'man task-faq' "
|
||||
"or at http://taskwarrior.org"
|
||||
+ "\n"
|
||||
+ "\n"
|
||||
|
||||
+ "<filter>\n"
|
||||
" Used to restrict the visible data.\n"
|
||||
"\n"
|
||||
|
||||
+ "<modfications>\n"
|
||||
" Changes to apply to the filtered data.\n"
|
||||
"\n"
|
||||
|
||||
+ "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";
|
||||
+ STRING_CMD_HELP_TEXT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue