mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Bug #618
- 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:
parent
8fefc8c12a
commit
86eef4c184
7 changed files with 57 additions and 27 deletions
|
@ -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
2
NEWS
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 "
|
||||
|
|
66
src/edit.cpp
66
src/edit.cpp
|
@ -110,22 +110,26 @@ static std::string formatDate (
|
|||
static std::string formatTask (Task task)
|
||||
{
|
||||
std::stringstream before;
|
||||
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"
|
||||
<< "# quit your editor, taskwarrior will read this file and try to make sense\n"
|
||||
<< "# of what changed, and apply those changes. If you quit your editor\n"
|
||||
<< "# without saving or making any modifications, taskwarrior will do nothing.\n"
|
||||
<< "#\n"
|
||||
<< "# Lines that begin with # represent data you cannot change, like ID.\n"
|
||||
<< "# If you get too 'creative' with your editing, taskwarrior will dump you\n"
|
||||
<< "# back into the editor to try again.\n"
|
||||
<< "#\n"
|
||||
<< "# 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"
|
||||
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"
|
||||
<< "# quit your editor, taskwarrior will read this file and try to make sense\n"
|
||||
<< "# of what changed, and apply those changes. If you quit your editor\n"
|
||||
<< "# without saving or making any modifications, taskwarrior will do nothing.\n"
|
||||
<< "#\n"
|
||||
<< "# Lines that begin with # represent data you cannot change, like ID.\n"
|
||||
<< "# If you get too 'creative' with your editing, taskwarrior will dump you\n"
|
||||
<< "# back into the editor to try again.\n"
|
||||
<< "#\n"
|
||||
<< "# 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";
|
||||
|
||||
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);
|
||||
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"
|
||||
|
||||
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";
|
||||
|
||||
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 ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue