///////////////////////////////////////////////////////////////////////////
| 54 | |
| 55 | //////////////////////////////////////////////////////////////////////////////// |
| 56 | int CmdHelp::execute(std::string& output) { |
| 57 | auto words = Context::getContext().cli2.getWords(); |
| 58 | if (words.size() == 1 && closeEnough("usage", words[0])) |
| 59 | output = '\n' + composeUsage() + '\n'; |
| 60 | else |
| 61 | output = |
| 62 | '\n' + composeUsage() + '\n' + |
| 63 | "Documentation for Taskwarrior can be found using 'man task', 'man taskrc', 'man " |
| 64 | "task-color', 'man task-sync' or at https://taskwarrior.org\n" |
| 65 | "\n" |
| 66 | "The general form of commands is:\n" |
| 67 | " task [<filter>] <command> [<mods>]\n" |
| 68 | "\n" |
| 69 | "The <filter> consists of zero or more restrictions on which tasks to select, " |
| 70 | "such as:\n" |
| 71 | " task <command> <mods>\n" |
| 72 | " task 28 <command> <mods>\n" |
| 73 | " task +weekend <command> <mods>\n" |
| 74 | " task project:Home due.before:today <command> <mods>\n" |
| 75 | " task ebeeab00-ccf8-464b-8b58-f7f2d606edfb <command> <mods>\n" |
| 76 | "\n" |
| 77 | "By default, filter elements are combined with an implicit 'and' operator, but " |
| 78 | "'or' and 'xor' may also be used, provided parentheses are included:\n" |
| 79 | " task '(/[Cc]at|[Dd]og/ or /[0-9]+/)' <command> <mods>\n" |
| 80 | "\n" |
| 81 | "A filter may target specific tasks using ID or UUID numbers. To specify " |
| 82 | "multiple tasks use one of these forms:\n" |
| 83 | " task 1,2,3 delete\n" |
| 84 | " task 1-3 info\n" |
| 85 | " task 1,2-5,19 modify pri:H\n" |
| 86 | " task 4-7 ebeeab00-ccf8-464b-8b58-f7f2d606edfb info\n" |
| 87 | "\n" |
| 88 | "The <mods> consist of zero or more changes to apply to the selected tasks, " |
| 89 | "such as:\n" |
| 90 | " task <filter> <command> project:Home\n" |
| 91 | " task <filter> <command> +weekend +garden due:tomorrow\n" |
| 92 | " task <filter> <command> Description/annotation text\n" |
| 93 | " task <filter> <command> /from/to/ <- replace first match\n" |
| 94 | " task <filter> <command> /from/to/g <- replace all matches\n" |
| 95 | "\n" |
| 96 | "Tags are arbitrary words, any quantity:\n" |
| 97 | " +tag The + means add the tag\n" |
| 98 | " -tag The - means remove the tag\n" |
| 99 | "\n" |
| 100 | "Built-in attributes are:\n" |
| 101 | " description: Task description text\n" |
| 102 | " status: Status of task - pending, completed, deleted, waiting\n" |
| 103 | " project: Project name\n" |
| 104 | " priority: Priority\n" |
| 105 | " due: Due date\n" |
| 106 | " recur: Recurrence frequency\n" |
| 107 | " until: Expiration date of a task\n" |
| 108 | " limit: Desired number of rows in report, or 'page'\n" |
| 109 | " wait: Date until task becomes pending\n" |
| 110 | " entry: Date task was created\n" |
| 111 | " end: Date task was completed/deleted\n" |
| 112 | " start: Date task was started\n" |
| 113 | " scheduled: Date task is scheduled to start\n" |