From c223d38872d54c8bac9e8835b17e7e20b87526f6 Mon Sep 17 00:00:00 2001
From: Paul Beckingham
Date: Sun, 24 May 2009 22:32:36 -0400
Subject: [PATCH] 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.
---
AUTHORS | 8 ++-
ChangeLog | 2 +
html/advanced.html | 12 ++++
html/faq.html | 18 ++++++
html/task.html | 2 +
src/parse.cpp | 154 +++++++++++++++++++++++++--------------------
src/task.cpp | 2 +
7 files changed, 128 insertions(+), 70 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 06795c1c6..55267243a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,12 @@
Principal Author:
Paul Beckingham
+Package Maintainer & Contributing Author:
+ Federico Hernandez
+
+Designer:
+ David J Patrick
+
Contributing Authors:
Damian Glenny
Andy Lester
@@ -10,9 +16,7 @@ Contributing Authors:
Benjamin Tegarden
Chris Pride
Richard Querin
- Federico Hernandez
T. Charles Yun
- David J Patrick
P.C. Shyamshankar
Johan Friis
Steven de Brouwer
diff --git a/ChangeLog b/ChangeLog
index 754e3f5aa..4292528be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@
+ Fixed documentation errors (thanks to Thomas@BIC).
+ The 'weekstart' configuration variable now controls the 'calendar'
command (thanks to Federico Hernandez).
+ + Supports '--' argument to indicate that all subsequence arguments are
+ part of the description, despite what they otherwise might mean.
------ old releases ------------------------------
diff --git a/html/advanced.html b/html/advanced.html
index 9f2a538ce..07ad69021 100644
--- a/html/advanced.html
+++ b/html/advanced.html
@@ -485,6 +485,18 @@ on_white on_bright_white
Note also that this capability does depend on whether your terminal
program can display these colors.
+
+ % task add project:Home -- pri:H +tag /from/to/
+
+ 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.
+
diff --git a/html/faq.html b/html/faq.html
index fa65a0e56..b1c7950fa 100644
--- a/html/faq.html
+++ b/html/faq.html
@@ -175,6 +175,24 @@
+
+
+ Q: How do I use '+word' in a task description, and prevent it
+ from being interpreted as a tag?
+
+
+ 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:
+
% task add -- +tag
+ Allows the task description to be "+tag". If you use the
+ command:
+ % task <id> edit
+ Then you are free to put (almost) anything in the description
+ field without task interpreting it.
+
+