Config: Changed to 0/1 boolean values for the defaults.

- Deprecated use of alternate Boolean configuration settings. Use values "0" for
  off, and "1" for on. Avoid used of "on", "off", "true", "t", "false", "f",
  "yes", "y", "no", "n".
This commit is contained in:
Paul Beckingham 2016-09-04 16:11:04 -04:00
parent b7e71a1c3c
commit 2e11c3c104
4 changed files with 136 additions and 129 deletions

View file

@ -61,45 +61,45 @@ std::string Config::_defaults =
"\n"
"# Files\n"
"data.location=~/.task\n"
"locking=on # Use file-level locking\n"
"gc=on # Garbage-collect data files - DO NOT CHANGE unless you are sure\n"
"exit.on.missing.db=no # Whether to exit if ~/.task is not found\n"
"hooks=on # Master control switch for hooks\n"
"locking=1 # Use file-level locking\n"
"gc=1 # Garbage-collect data files - DO NOT CHANGE unless you are sure\n"
"exit.on.missing.db=0 # Whether to exit if ~/.task is not found\n"
"hooks=1 # Master control switch for hooks\n"
"\n"
"# Terminal\n"
"detection=on # Detects terminal width\n"
"detection=1 # Detects terminal width\n"
"defaultwidth=80 # Without detection, assumed width\n"
"defaultheight=24 # Without detection, assumed height\n"
"avoidlastcolumn=no # Fixes Cygwin width problem\n"
"hyphenate=on # Hyphenates lines wrapped on non-word-breaks\n"
"avoidlastcolumn=0 # Fixes Cygwin width problem\n"
"hyphenate=1 # Hyphenates lines wrapped on non-word-breaks\n"
"#editor=vi # Preferred text editor\n"
"reserved.lines=1 # Assume a 1-line prompt\n"
"\n"
"# Miscellaneous\n"
"# # Comma-separated list. May contain any subset of:\n"
"verbose=blank,header,footnote,label,new-id,new-uuid,affected,edit,special,project,sync,unwait,recur\n"
"confirmation=yes # Confirmation on delete, big changes\n"
"recurrence=yes # Enable recurrence\n"
"confirmation=1 # Confirmation on delete, big changes\n"
"recurrence=1 # Enable recurrence\n"
"recurrence.confirmation=prompt # Confirmation for propagating changes among recurring tasks (yes/no/prompt)\n"
"allow.empty.filter=yes # An empty filter gets a warning and requires confirmation\n"
"allow.empty.filter=1 # An empty filter gets a warning and requires confirmation\n"
"indent.annotation=2 # Indent spaces for annotations\n"
"indent.report=0 # Indent spaces for whole report\n"
"row.padding=0 # Left and right padding for each row of report\n"
"column.padding=1 # Spaces between each column in a report\n"
"bulk=3 # 3 or more tasks considered a bulk change and is confirmed\n"
"nag=You have more urgent tasks. # Nag message to keep you honest\n" // TODO
"search.case.sensitive=yes # Setting to no allows case insensitive searches\n"
"search.case.sensitive=1 # Setting to no allows case insensitive searches\n"
"active.indicator=* # What to show as an active task indicator\n"
"tag.indicator=+ # What to show as a tag indicator\n"
"dependency.indicator=D # What to show as a dependency indicator\n"
"recurrence.indicator=R # What to show as a task recurrence indicator\n"
"recurrence.limit=1 # Number of future recurring pending tasks\n"
"undo.style=side # Undo style - can be 'side', or 'diff'\n"
"regex=yes # Assume all search/filter strings are regexes\n"
"xterm.title=no # Sets xterm title for some commands\n"
"regex=1 # Assume all search/filter strings are regexes\n"
"xterm.title=0 # Sets xterm title for some commands\n"
"expressions=infix # Prefer infix over postfix expressions\n"
"json.array=on # Enclose JSON output in [ ]\n"
"json.depends.array=off # Encode dependencies as a JSON array\n"
"json.array=1 # Enclose JSON output in [ ]\n"
"json.depends.array=0 # Encode dependencies as a JSON array\n"
"abbreviation.minimum=2 # Shortest allowed abbreviation\n"
"\n"
"# Dates\n"
@ -109,31 +109,31 @@ std::string Config::_defaults =
"dateformat.info=Y-M-D H:N:S # Preferred display date format for information\n"
"dateformat.report= # Preferred display date format for reports\n"
"dateformat.annotation= # Preferred display date format for annotations\n"
"date.iso=yes # Enable ISO date support\n"
"date.iso=1 # Enable ISO date support\n"
"weekstart="
STRING_DATE_SUNDAY
" # Sunday or Monday only\n"
"displayweeknumber=yes # Show week numbers on calendar\n"
"displayweeknumber=1 # Show week numbers on calendar\n"
"due=7 # Task is considered due in 7 days\n"
"\n"
"# Calendar controls\n"
"calendar.legend=yes # Display the legend on calendar\n"
"calendar.legend=1 # Display the legend on calendar\n"
"calendar.details=sparse # Calendar shows information for tasks w/due dates: full, sparse or none\n"
"calendar.details.report=list # Report to use when showing task information in cal\n"
"calendar.offset=no # Apply an offset value to control the first month of the calendar\n"
"calendar.offset=0 # Apply an offset value to control the first month of the calendar\n"
"calendar.offset.value=-1 # The number of months the first month of the calendar is moved\n"
"calendar.holidays=none # Show public holidays on calendar:full, sparse or none\n"
"#monthsperline=3 # Number of calendar months on a line\n"
"\n"
"# Journal controls\n"
"journal.time=no # Record start/stop commands as annotation\n"
"journal.time=0 # Record start/stop commands as annotation\n"
"journal.time.start.annotation=Started task # Annotation description for the start journal entry\n"
"journal.time.stop.annotation=Stopped task # Annotation description for the stop journal entry\n"
"journal.info=on # Display task journal with info command\n"
"journal.info=1 # Display task journal with info command\n"
"\n"
"# Dependency controls\n"
"dependency.reminder=on # Nags on dependency chain violations\n"
"dependency.confirmation=on # Should dependency chain repair be confirmed?\n"
"dependency.reminder=1 # Nags on dependency chain violations\n"
"dependency.confirmation=1 # Should dependency chain repair be confirmed?\n"
"\n"
"# Urgency Coefficients\n"
"urgency.user.tag.next.coefficient=15.0 # Urgency coefficient for 'next' special tag\n"
@ -147,7 +147,7 @@ std::string Config::_defaults =
"urgency.project.coefficient=1.0 # Urgency coefficient for projects\n"
"urgency.blocked.coefficient=-5.0 # Urgency coefficient for blocked tasks\n"
"urgency.waiting.coefficient=-3.0 # Urgency coefficient for waiting status\n"
"urgency.inherit=off # Recursively inherit highest urgency value from blocked tasks\n"
"urgency.inherit=0 # Recursively inherit highest urgency value from blocked tasks\n"
"urgency.age.max=365 # Maximum age in days\n"
"\n"
"#urgency.user.project.foo.coefficient=5.0 # Urgency coefficients for 'foo' project\n"
@ -155,12 +155,12 @@ std::string Config::_defaults =
"#urgency.uda.foo.coefficient=5.0 # Urgency coefficients for UDA 'foo'\n"
"\n"
"# Color controls.\n"
"color=on # Enable color\n"
"color=1 # Enable color\n"
"\n"
"rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.\n"
"\n"
"# General decoration\n"
"rule.color.merge=yes\n"
"rule.color.merge=1\n"
"color.label=\n"
"color.label.sort=\n"
"color.alternate=on gray2\n"
@ -249,23 +249,23 @@ std::string Config::_defaults =
"#default.due=eom # Default due date for 'add' command\n"
"default.command=next # When no arguments are specified\n"
"\n"
"_forcecolor=no # Forces color to be on, even for non TTY output\n"
"complete.all.tags=no # Include old tag names in '_ags' command\n"
"list.all.projects=no # Include old project names in 'projects' command\n"
"summary.all.projects=no # Include old project names in 'summary' command\n"
"list.all.tags=no # Include old tag names in 'tags' command\n"
"print.empty.columns=no # Print columns which have no data for any task\n"
"debug=no # Display diagnostics\n"
"sugar=yes # Syntactic sugar\n"
"obfuscate=no # Obfuscate data for error reporting\n"
"fontunderline=yes # Uses underlines rather than -------\n"
"_forcecolor=0 # Forces color to be on, even for non TTY output\n"
"complete.all.tags=0 # Include old tag names in '_ags' command\n"
"list.all.projects=0 # Include old project names in 'projects' command\n"
"summary.all.projects=0 # Include old project names in 'summary' command\n"
"list.all.tags=0 # Include old tag names in 'tags' command\n"
"print.empty.columns=0 # Print columns which have no data for any task\n"
"debug=0 # Display diagnostics\n"
"sugar=1 # Syntactic sugar\n"
"obfuscate=0 # Obfuscate data for error reporting\n"
"fontunderline=1 # Uses underlines rather than -------\n"
"\n"
"# WARNING: Please read the documentation (man task-sync) before setting up\n"
"# Taskwarrior for Taskserver synchronization.\n"
"#taskd.ca <certificate file>\n"
"#taskd.certificate <certificate file>\n"
"#taskd.credentials <organization>/<name>/<password>\n"
"#taskd.server <server>:<port>\n"
"#taskd.ca=<certificate file>\n"
"#taskd.certificate=<certificate file>\n"
"#taskd.credentials=<organization>/<name>/<password>\n"
"#taskd.server=<server>:<port>\n"
"taskd.trust=strict\n"
"#taskd.trust=ignore hostname\n"
"#taskd.trust=allow all\n"
@ -594,12 +594,12 @@ bool Config::getBoolean (const std::string& key)
{
std::string value = Lexer::lowerCase ((*this)[key]);
if (value == "t" || // TODO Deprecate
value == "true" ||
value == "true" || // TODO Deprecate
value == "1" ||
value == "+" || // TODO Deprecate
value == "y" ||
value == "yes" ||
value == "on" ||
value == "y" || // TODO Deprecate
value == "yes" || // TODO Deprecate
value == "on" || // TODO Deprecate
value == "enable" || // TODO Deprecate
value == "enabled") // TODO Deprecate
return true;