Configuration

- Added support for rc.dom, which enables/disables DOM support.
This commit is contained in:
Paul Beckingham 2011-08-01 01:39:21 -04:00
parent a7f694386a
commit cc51c50f84
5 changed files with 23 additions and 3 deletions

1
NEWS
View file

@ -49,6 +49,7 @@ New configuration options in taskwarrior 2.0.0
- New 'avoidlastcolumn' support for Cygwin users. - New 'avoidlastcolumn' support for Cygwin users.
- New 'patterns' enables/disables command line pattern support. - New 'patterns' enables/disables command line pattern support.
- New 'expressions' enables/disables command line expression support. - New 'expressions' enables/disables command line expression support.
- New 'dom' enables/disables DOM support for the command line.
- New 'json.array' determines whether 'query' command output is enclosed by - New 'json.array' determines whether 'query' command output is enclosed by
'[...]'. '[...]'.
- New 'regex' control determines whether substitutions use Regular Expressions - New 'regex' control determines whether substitutions use Regular Expressions

View file

@ -315,6 +315,11 @@ Defaults to on.
Enables or disables algebraic expression support on the command line, such as Enables or disables algebraic expression support on the command line, such as
"due<eom and (pri=H or pri=M)". Defaults to on. "due<eom and (pri=H or pri=M)". Defaults to on.
.TP
.B dom=on
Enables or disables access to taskwarrior internals and task metadata on the
command line. Defaults to on.
.TP .TP
.B json.array=off .B json.array=off
Determines whether the query command encloses the JSON output in '[...]' to Determines whether the query command encloses the JSON output in '[...]' to

View file

@ -101,6 +101,7 @@ std::string Config::defaults =
"xterm.title=no # Sets xterm title for some commands\n" "xterm.title=no # Sets xterm title for some commands\n"
"expressions=on # Support for algebraic expressions\n" "expressions=on # Support for algebraic expressions\n"
"patterns=on # Support for regex patterns\n" "patterns=on # Support for regex patterns\n"
"dom=on # Support DOM access\n"
"json.array=off # Enclose JSON output in [ ]\n" "json.array=off # Enclose JSON output in [ ]\n"
"abbreviation.minimum=2 # Shortest allowed abbreviation\n" "abbreviation.minimum=2 # Shortest allowed abbreviation\n"
"\n" "\n"

View file

@ -98,7 +98,11 @@ void E9::eval (const Task& task, std::vector <Term>& value_stack)
if (right._category == "dom") if (right._category == "dom")
{ {
right._value = context.dom.get (right._raw, task); if (context.config.getBoolean ("dom"))
right._value = context.dom.get (right._raw, task);
else
right._value = right._raw;
right._category = "string"; right._category = "string";
} }
@ -116,7 +120,11 @@ void E9::eval (const Task& task, std::vector <Term>& value_stack)
if (right._category == "dom") if (right._category == "dom")
{ {
right._value = context.dom.get (right._raw, task); if (context.config.getBoolean ("dom"))
right._value = context.dom.get (right._raw, task);
else
right._value = right._raw;
right._category = "string"; right._category = "string";
} }
@ -125,7 +133,11 @@ void E9::eval (const Task& task, std::vector <Term>& value_stack)
if (left._category == "dom") if (left._category == "dom")
{ {
left._value = context.dom.get (left._raw, task); if (context.config.getBoolean ("dom"))
left._value = context.dom.get (left._raw, task);
else
left._value = left._raw;
left._category = "string"; left._category = "string";
} }

View file

@ -140,6 +140,7 @@ int CmdShow::execute (std::string& output)
" dependency.reminder" " dependency.reminder"
" detection" " detection"
" displayweeknumber" " displayweeknumber"
" dom"
" due" " due"
" echo.command" " echo.command"
" edit.verbose" " edit.verbose"