diff --git a/ChangeLog b/ChangeLog
index 95dd2b958..6a8668408 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,8 @@ represents a feature release, and the Z represents a patch.
+ Automatically shuts off color, curses when output is not a tty
+ Supports relative due: dates (tomorrow, wednesday, 23rd, eom ...)
+ Supports the ~ character in .taskrc data.location
+ + Allows colons on the description, provided what is to the left of the colon
+ is not a standard attribute name
+ Bug: Fixed where Esc[0m sequences were being emitted for no good reason
+ Bug: Fixed underlined table headers when color is turned off
+ Bug: Adding a blank priority resulted in an assigned garbage value
diff --git a/html/task.html b/html/task.html
index 11218fd7d..e80ed9655 100644
--- a/html/task.html
+++ b/html/task.html
@@ -60,6 +60,8 @@
Added support for task filtering on all reports
Automatically shuts off color, ncurses when output is not to a tty
Added support for the ~ character in .taskrc data.location, for flexibility
+ Allows colons on the description, provided what is to the left of the colon
+ is not a standard attribute name
Fixed bug where Esc[0m sequences were being emitted for no good reason
Fixed bug where table headers are underlined when color is turned off
Fixed bug where adding a blank priority resulted in an assigned garbage value
diff --git a/src/parse.cpp b/src/parse.cpp
index 2506fb9fd..89d30184b 100644
--- a/src/parse.cpp
+++ b/src/parse.cpp
@@ -110,6 +110,7 @@ static const char* attributes[] =
"recur",
"until",
"mask",
+ "imask",
"",
};
@@ -157,7 +158,8 @@ void guess (const std::string& type, const char** list, std::string& candidate)
candidate = matches[0];
else if (0 == matches.size ())
- throw std::string ("Unrecognized ") + type + " '" + candidate + "'";
+// throw std::string ("Unrecognized ") + type + " '" + candidate + "'";
+ candidate = "";
else
{
@@ -225,32 +227,37 @@ static bool validAttribute (
Config& conf)
{
guess ("attribute", attributes, name);
-
- if ((name == "fg" || name == "bg") && value != "")
- guess ("color", colors, value);
-
- else if (name == "due" && value != "")
- validDate (value, conf);
-
- else if (name == "until" && value != "")
- validDate (value, conf);
-
- else if (name == "priority")
+ if (name != "")
{
- value = upperCase (value);
- return validPriority (value);
+ if ((name == "fg" || name == "bg") && value != "")
+ guess ("color", colors, value);
+
+ else if (name == "due" && value != "")
+ validDate (value, conf);
+
+ else if (name == "until" && value != "")
+ validDate (value, conf);
+
+ else if (name == "priority")
+ {
+ value = upperCase (value);
+ return validPriority (value);
+ }
+
+ // Some attributes are intended to be private.
+ else if (name == "entry" ||
+ name == "start" ||
+ name == "end" ||
+ name == "mask" ||
+ name == "imask")
+ throw std::string ("\"") +
+ name +
+ "\" is not an attribute you may modify directly.";
+
+ return true;
}
- // Some attributes are intended to be private.
- else if (name == "entry" ||
- name == "start" ||
- name == "end" ||
- name == "mask")
- throw std::string ("\"") +
- name +
- "\" is not an attribute you may modify directly.";
-
- return true;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
@@ -285,7 +292,12 @@ static bool validDescription (const std::string& input)
////////////////////////////////////////////////////////////////////////////////
static bool validCommand (std::string& input)
{
- guess ("command", commands, input);
+ std::string copy = input;
+ guess ("command", commands, copy);
+ if (copy == "")
+ return false;
+
+ input = copy;
return true;
}
@@ -380,8 +392,15 @@ void parse (
std::string value = arg.substr (colon + 1, std::string::npos);
if (validAttribute (name, value, conf))
+ {
if (name != "recur" || validDuration (value))
task.setAttribute (name, value);
+ }
+
+ // If it is not a valid attribute, then allow the argument as part of
+ // the description.
+ else
+ descCandidate += arg;
}
// Substitution of description text.
@@ -393,10 +412,10 @@ void parse (
// Command.
else if (command == "")
{
- if (!isCommand (arg))
- descCandidate += std::string (arg) + " ";
- else if (validCommand (arg))
+ if (isCommand (arg) && validCommand (arg))
command = arg;
+ else
+ throw std::string ("'") + arg + "' is not a valid command.";
}
// Anything else is just considered description.