Enhancement - Supports '--' on the command line

- Using '--' on the command line separates the left hand side, where
  task is free to interpret arguments in the usual way, and the right
  hand side, which is then assumed to be part of the task description,
  and is not interpreted by task.
This commit is contained in:
Paul Beckingham
2009-05-24 22:32:36 -04:00
parent 020604334e
commit c223d38872
7 changed files with 128 additions and 70 deletions

View File

@@ -485,6 +485,18 @@ on_white on_bright_white</code></pre>
Note also that this capability does depend on whether your terminal
program can display these colors.
</p>
<strong>% task add project:Home -- pri:H +tag /from/to/</strong>
<p>
The -- argument can be used to tell task to stop interpreting
the command line arguments. In the example above, a new task
is added for the project 'Home', then the -- argument appears,
and therefore all remaining arguments are part of the
description. In this case, the description is "pri:H +tag
/from/to/". This is one way to override task's interpretation
of the command line. The other way is to put the entire
description in quotes.
</p>
</div>
<br />

View File

@@ -175,6 +175,24 @@
</p>
<hr>
<p>
<b>
Q: How do I use '+word' in a task description, and prevent it
from being interpreted as a tag?
</b>
<br />
A: There are several ways to do this. The simplest is to use
the '--' argument in the command line, and task will assume
that everything afterwards is part of the description. For
example:
<pre><code>% task add -- +tag</code></pre>
Allows the task description to be "+tag". If you use the
command:
<pre><code>% task &lt;id&gt; edit</code></pre>
Then you are free to put (almost) anything in the description
field without task interpreting it.
</p>
<hr>
<!--
<p>
<b>

View File

@@ -138,6 +138,8 @@
<li>Fixed documentation errors (thanks to Thomas@BIC).
<li>The 'weekstart' configuration variable now controls the 'calendar'
command (thanks to Federico Hernandez).
<li>Supports '--' argument to indicate that all subsequence arguments are
part of the description, despite what they otherwise might mean.
</ul>
<p>