From 160c9708a5c734880a4e8c482570a8687286c321 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 1 Oct 2011 11:34:05 -0400 Subject: [PATCH] Verbosity - Deprecated 'rc.edit.verbose'. - Added support for verbosity token 'edit'. - Updated documentation. --- NEWS | 5 ++++- doc/man/taskrc.5.in | 3 ++- src/Config.cpp | 4 ++-- src/commands/CmdEdit.cpp | 3 ++- src/commands/CmdShow.cpp | 2 +- test/verbose.t | 1 + 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index b11b463d8..73f95dc0c 100644 --- a/NEWS +++ b/NEWS @@ -70,7 +70,10 @@ Newly deprecated features in taskwarrior 2.0.0 - The 'next' configuration variable has been removed. - Use of 'fg:' and 'bg:' attributes are deprecated. - - Use of 'echo.command' configuration variable. + - Use of 'echo.command' configuration variable. Use verbosity token + 'affected' instead. + - Use of 'edit.verbose' configuration variable. Use verbosity token 'edit' + instead. --- diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 792d2bbdf..ddfad6c98 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -200,7 +200,7 @@ environment variables, before it defaults to using "vi". 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. +help text. Deprecated - use verbosity token 'edit'. .SS MISCELLANEOUS @@ -219,6 +219,7 @@ control specific occasions when output is generated. This list may contain: label Column labels on tabular reports new-id Provides feedback of any new task IDs affected Reports 'N tasks affected' and similar + edit Used the verbose template for the 'edit' command Note that the "on" setting is equivalent to all the tokens being specified, and the "off" setting is equivalent to none of the tokens being specified. diff --git a/src/Config.cpp b/src/Config.cpp index 153f2fc12..e70637af1 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -75,13 +75,13 @@ std::string Config::_defaults = "avoidlastcolumn=no # Fixes Cygwin width problem\n" "hyphenate=on # Hyphenates lines wrapped on non-word-breaks\n" "#editor=vi # Preferred text editor\n" - "edit.verbose=yes # Include comments in files created during task edit\n" + "edit.verbose=yes # Include comments in files created during task edit. Deprecated\n" "\n" "# Miscellaneous\n" "verbose=yes # Provide maximal feedback\n" "#verbose=no # Provide minimal feedback\n" "#verbose=list # Comma-separated list. May contain any subset of:\n" - "#verbose=blank,header,footnote,label,new-id,affected\n" + "#verbose=blank,header,footnote,label,new-id,affected,edit\n" "confirmation=yes # Confirmation on delete, big changes\n" "echo.command=yes # Details on command just run. Deprecated\n" "annotations=full # Level of verbosity for annotations: full, sparse or none\n" diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 623b09c8d..228731691 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -138,7 +138,8 @@ std::string CmdEdit::formatDate ( std::string CmdEdit::formatTask (Task task) { std::stringstream before; - bool verbose = context.config.getBoolean ("edit.verbose"); + bool verbose = context.verbose ("edit") || + context.config.getBoolean ("edit.verbose"); // Deprecated 2.0 if (verbose) before << "# The 'task edit ' command allows you to modify all aspects of a task\n" diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index 7d68f516f..b8182d012 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -144,7 +144,7 @@ int CmdShow::execute (std::string& output) " dom" " due" " echo.command" // Deprecated 2.0 - " edit.verbose" + " edit.verbose" // Deprecated 2.0 " editor" " exit.on.missing.db" " export.ical.class" diff --git a/test/verbose.t b/test/verbose.t index dc0ede14a..de187d2ca 100755 --- a/test/verbose.t +++ b/test/verbose.t @@ -51,6 +51,7 @@ unlike ($output, qr/Logged task/, '\'affected\' verbosity good'); # TODO Verbosity: 'label' # TODO Verbosity: 'header' # TODO Verbosity: 'footer' +# TODO Verbosity: 'edit' # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key verbose.rc);