- Applied patch to fix bug #618, so that the configuration setting
  'edit.verbose' can be set to 'no' and eliminate the help text when using
  the 'task edit' command (thanks to Steve Rader).

Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
Steve Rader 2011-01-05 08:56:28 -05:00 committed by Paul Beckingham
parent 8fefc8c12a
commit 86eef4c184
7 changed files with 57 additions and 27 deletions

View file

@ -69,6 +69,9 @@
+ Applied patch to fix bug #613, so that the summary report and the projects
command now consistently show a missing project as "(none)" (thanks to
Steve Rader).
+ Applied patch to fix bug #618, so that the configuration setting
'edit.verbose' can be set to 'no' and eliminate the help text when using
the 'task edit' command (thanks to Steve Rader).
------ old releases ------------------------------

2
NEWS
View file

@ -44,6 +44,8 @@ New configuration options in taskwarrior 1.9.4
to change the effective first month in the calendar report.
- default.due can be specified, and adds a default due date to all added
and imported tasks that don't otherwise have a due date.
- edit.verbose can be set to 'off' to eliminated the help text when using
the 'task edit' command.
Newly deprecated features in taskwarrior 1.9.4

View file

@ -247,7 +247,8 @@ mistakes.
.TP
.B edit ID
Launches an editor to let you modify all aspects of a task directly.
Use carefully.
In general, this is not the recommended method of modifying tasks, but is
provided for exceptional circumstances. Use carefully.
.TP
.B append [tags] [attrs] description

View file

@ -173,6 +173,13 @@ command is used. Taskwarrior will first look for this configuration variable. If
found, it is used. Otherwise it will look for the $VISUAL or $EDITOR
environment variables, before it defaults to using "vi".
.TP
.B edit.verbose=on
When set to on (the default), helpful explanatory comments are added to the
edited file when using the "task edit ..." command. Setting this to off means
that you would see a smaller, more compact representation of the task, with no
help text.
.SS MISCELLANEOUS
.TP

View file

@ -66,6 +66,7 @@ std::string Config::defaults =
"curses=on # Detects terminal width\n"
"defaultwidth=80 # Without detection, assumed width\n"
"#editor=vi # Preferred text editor\n"
"edit.verbose=yes # Include comments in files created during task edit\n"
"\n"
"# Miscellaneous\n"
"verbose=yes # Provide extra feedback\n"

View file

@ -1153,7 +1153,7 @@ int handleShow (std::string& outs)
"export.ical.class echo.command fontunderline gc locking monthsperline "
"nag next journal.time journal.time.start.annotation journal.info "
"journal.time.stop.annotation project shadow.command shadow.file "
"shadow.notify weekstart editor import.synonym.id import.synonym.uuid "
"shadow.notify weekstart editor edit.verbose import.synonym.id import.synonym.uuid "
"complete.all.projects complete.all.tags search.case.sensitive hooks "
"active.indicator tag.indicator recurrence.indicator recurrence.limit "
"list.all.projects list.all.tags undo.style verbose rule.precedence.color "

View file

@ -110,6 +110,9 @@ static std::string formatDate (
static std::string formatTask (Task task)
{
std::stringstream before;
bool verbose = context.config.getBoolean ("edit.verbose");
if (verbose)
before << "# The 'task edit <id>' command allows you to modify all aspects of a task\n"
<< "# using a text editor. What is shown below is a representation of the\n"
<< "# task in all it's detail. Modify what you wish, and if you save and\n"
@ -124,8 +127,9 @@ static std::string formatTask (Task task)
<< "# Should you find yourself in an endless Groundhog Day loop, editing and\n"
<< "# editing the same file, just quit the editor without making any changes.\n"
<< "# Taskwarrior will notice this and stop the editing.\n"
<< "#\n"
<< "# Name Editable details\n"
<< "#\n";
before << "# Name Editable details\n"
<< "# ----------------- ----------------------------------------------------\n"
<< "# ID: " << task.id << "\n"
<< "# UUID: " << task.get ("uuid") << "\n"
@ -139,10 +143,14 @@ static std::string formatTask (Task task)
task.getTags (tags);
std::string allTags;
join (allTags, " ", tags);
if (verbose)
before << "# Separate the tags with spaces, like this: tag1 tag2\n"
<< " Tags: " << allTags << "\n"
<< "# The description field is allowed to wrap and use multiple lines. Task\n"
<< "# will combine them.\n"
<< "# will combine them.\n";
before << " Tags: " << allTags << "\n"
<< " Description: " << task.get ("description") << "\n"
<< " Created: " << formatDate (task, "entry") << "\n"
<< " Started: " << formatDate (task, "start") << "\n"
@ -153,9 +161,14 @@ static std::string formatTask (Task task)
<< " Wait until: " << formatDate (task, "wait") << "\n"
<< " Parent: " << task.get ("parent") << "\n"
<< " Foreground color: " << task.get ("fg") << "\n"
<< " Background color: " << task.get ("bg") << "\n"
<< "# Annotations look like this: <date> -- <text> and there can be any number of them\n"
<< "# ' -- ' is the separator between the date and text field. It should not be removed\n";
<< " Background color: " << task.get ("bg") << "\n";
if (verbose)
before << "# Annotations look like this: <date> -- <text> and there can be any number of them.\n"
<< "# The ' -- ' separator between the date and text field should not be removed.\n"
<< "# A \"blank slot\" for adding an annotation follows for your convenience.\n";
before << " Background color: " << task.get ("bg") << "\n";
std::vector <Att> annotations;
task.getAnnotations (annotations);
@ -175,8 +188,11 @@ static std::string formatTask (Task task)
task.getDependencies (dependencies);
std::string allDeps;
join (allDeps, ",", dependencies);
before << "# Dependencies should be a comma-separated list of task IDs, with no spaces.\n"
<< " Dependencies: " << allDeps << "\n";
if (verbose)
before << "# Dependencies should be a comma-separated list of task IDs, with no spaces.\n";
before << " Dependencies: " << allDeps << "\n";
before << "# End\n";
return before.str ();