Merge branch '1.9.4' of tasktools.org:task into 1.9.4

This commit is contained in:
Paul Beckingham 2011-01-09 21:25:59 -05:00
commit 77f26994a6
3 changed files with 50 additions and 32 deletions

View file

@ -14,6 +14,11 @@
+ Added ability to temporarily suspend GC (rc.gc:0) for a given command, which
helps scriptwriters implement shadow files externally (thanks to Sander
Marechal).
+ Added feature #30, which eliminates the dependency on ncurses (thanks to
Johan Friis).
+ Added feature #157, which implements the _query command, a helper command for
script writers, which accepts a filter like any other report, but returns
only full JSON.
+ Added feature #158, regular expression support for filters and substitutions.
+ Added feature #247, providing infinite width reports when redirecting output
to a file, by setting defaultwidth to 0.
@ -26,8 +31,6 @@
+ Added feature #574, default due dates (thanks to Erlan Sergaziev).
+ Added feature #575, including Danish holidays (thanks to Irfan Siddiqui).
+ Eliminated dependency on ncurses.
+ Added _query helper command for script writers, which accepts a filter like
any other report, but returns only full JSON.
+ The dependency columns are now right-justified (thanks to Eric Fluger).
+ Fixed bug that caused the 'done' command to always exit with a non-zero
status (thanks to Steve Rader).

View file

@ -31,7 +31,6 @@ typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
_task_projects=($(task _projects))
_task_tags=($(task _tags))
_task_ids=($(task _ids))
_task_zshids=( ${(f)"$(task _zshids)"} )
_task_config=($(task _config))
_task_modifiers=(
'before' \
@ -50,20 +49,18 @@ _task_modifiers=(
_task_cmds=($(task _commands))
_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
# concat zshcmds and zshids
_task_cmds_ids=($_task_zshcmds $_task_zshids)
_task_idCmds=(
'append:Appends more description to an existing task.' \
'prepend:Prepends more description to an existing task.' \
'annotate:Adds an annotation to an existing task.' \
'denotate:Deletes an annotation of an existing task.' \
'edit:Launches an editor to let you modify a task directly.' \
'duplicate:Duplicates the specified task, and allows modifications.' \
'info:Shows all data, metadata for specified task.' \
'start:Marks specified task as started.' \
'stop:Removes the start time from a task.' \
'done:Marks the specified task as completed.'
'append' \
'prepend' \
'annotate' \
'denotate' \
'edit' \
'duplicate' \
'info' \
'start' \
'stop' \
'done'
)
_task_idCmdsDesc=(
@ -90,7 +87,7 @@ word=$'[^\0]#\0'
# priorities
local -a task_priorities
_regex_words task_prios 'task priorities' \
_regex_words values 'task priorities' \
'H:High' \
'M:Middle' \
'L:Low'
@ -100,11 +97,11 @@ task_priorities=("$reply[@]")
local -a task_projects
task_projects=(
/"$word"/
":task_projects:task projects:compadd -a _task_projects"
":values:task projects:compadd -a _task_projects"
)
local -a _task_dates
_regex_words _task_dates 'task dates' \
_regex_words values 'task dates' \
'tod*ay:Today' \
'yes*terday:Yesterday' \
'tom*orrow:Tomorrow' \
@ -128,7 +125,7 @@ _regex_words _task_dates 'task dates' \
_task_dates=("$reply[@]")
local -a _task_reldates
_regex_words _task_reldates 'task reldates' \
_regex_words values 'task reldates' \
'hrs:n hours' \
'day:n days' \
'1st:first' \
@ -144,7 +141,7 @@ task_dates=(
\)
)
_regex_words _task_freqs 'task frequencies' \
_regex_words values 'task frequencies' \
'daily:Every day' \
'day:Every day' \
'weekdays:Every day skipping weekend days' \
@ -160,7 +157,7 @@ _regex_words _task_freqs 'task frequencies' \
_task_freqs=("$reply[@]")
local -a _task_frequencies
_regex_words _task_frequencies 'task frequencies' \
_regex_words values 'task frequencies' \
'd:days' \
'w:weeks' \
'q:quarters' \
@ -175,7 +172,7 @@ task_freqs=(
# attributes
local -a task_attributes
_regex_words -t ':' task_attr 'task attributes' \
_regex_words -t ':' default 'task attributes' \
'pro*ject:Project name:$task_projects' \
'du*e:Due date:$task_dates' \
'wa*it:Date until task becomes pending:$task_dates' \
@ -189,9 +186,9 @@ task_attributes=("$reply[@]")
args=(
\( "$task_attributes[@]" \|
\( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":task_mods:modifiers:compadd -S ':' -a _task_modifiers" \) \) \|
\( /'(rc).'/- \( /$'[^:]#:'/ ":task_config:config:compadd -S ':' -a _task_config" \) \) \|
\( /'(+|-)'/- \( /"$word"/ ":task_rtag:remove tag:compadd -a _task_tags" \) \) \|
\( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \|
\( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \|
\( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \|
\( /"$word"/ \)
\) \#
)
@ -209,7 +206,9 @@ _task_default() {
(( $+functions[_task_id] )) ||
_task_id() {
if (( CURRENT < 3 )); then
_describe -t ids 'task IDs' _task_zshids
# update IDs
_task_zshids=( ${(f)"$(task _zshids)"} )
_describe -t values 'task IDs' _task_zshids
else
_task_attributes "$@"
fi
@ -218,9 +217,25 @@ _task_id() {
# merge completion
(( $+functions[_task_merge] )) ||
_task_merge() {
# TODO match URIs in .taskrc
_files
}
# push completion
(( $+functions[_task_push] )) ||
_task_push() {
# TODO match URIs in .taskrc
_files
}
# pull completion
(( $+functions[_task_pull] )) ||
_task_pull() {
# TODO match URIs in .taskrc
_files
}
# modify (task [0-9]* ...) completion
(( $+functions[_task_modify] )) ||
_task_modify() {
@ -233,21 +248,22 @@ _task_modify() {
_task_commands() {
local cmd ret=1
if (( CURRENT == 1 )); then
#TODO fix descriptions
# update IDs
_task_zshids=( ${(f)"$(task _zshids)"} )
_describe -t commands 'task command' _task_cmds_ids
_describe -t commands 'task command' _task_zshcmds
_describe -t values 'task IDs' _task_zshids
# TODO match more than one ID
# TODO sorting (ids below commands)
elif [[ $words[1] =~ ^[0-9]*$ ]] then
_call_function ret _task_modify
return ret
else
local curcontext="${curcontext}"
# local curcontext="${curcontext}"
# cmd="${_task_cmds[(r)$words[1]:*]%%:*}"
cmd="${_task_cmds[(r)$words[1]]}"
idCmd="${(M)_task_idCmds[@]:#$words[1]}"
if (( $#cmd )); then
curcontext="${curcontext%:*:*}:task-${cmd}"
# curcontext="${curcontext%:*:*}:task-${cmd}"
if (( $#idCmd )); then
_call_function ret _task_id

View file

@ -388,7 +388,6 @@ int handleCustomReport (const std::string& report, std::string& outs)
{
Date dt (::atoi (created.c_str ()));
age = Duration (now - dt).formatCompact ();
context.hooks.trigger ("format-age_compact", "age_compact", age);
table.addCell (row, columnCount, age);
}