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 + Added ability to temporarily suspend GC (rc.gc:0) for a given command, which
helps scriptwriters implement shadow files externally (thanks to Sander helps scriptwriters implement shadow files externally (thanks to Sander
Marechal). 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 #158, regular expression support for filters and substitutions.
+ Added feature #247, providing infinite width reports when redirecting output + Added feature #247, providing infinite width reports when redirecting output
to a file, by setting defaultwidth to 0. to a file, by setting defaultwidth to 0.
@ -26,8 +31,6 @@
+ Added feature #574, default due dates (thanks to Erlan Sergaziev). + Added feature #574, default due dates (thanks to Erlan Sergaziev).
+ Added feature #575, including Danish holidays (thanks to Irfan Siddiqui). + Added feature #575, including Danish holidays (thanks to Irfan Siddiqui).
+ Eliminated dependency on ncurses. + 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). + 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 + Fixed bug that caused the 'done' command to always exit with a non-zero
status (thanks to Steve Rader). 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_projects=($(task _projects))
_task_tags=($(task _tags)) _task_tags=($(task _tags))
_task_ids=($(task _ids)) _task_ids=($(task _ids))
_task_zshids=( ${(f)"$(task _zshids)"} )
_task_config=($(task _config)) _task_config=($(task _config))
_task_modifiers=( _task_modifiers=(
'before' \ 'before' \
@ -50,20 +49,18 @@ _task_modifiers=(
_task_cmds=($(task _commands)) _task_cmds=($(task _commands))
_task_zshcmds=( ${(f)"$(task _zshcommands)"} ) _task_zshcmds=( ${(f)"$(task _zshcommands)"} )
# concat zshcmds and zshids
_task_cmds_ids=($_task_zshcmds $_task_zshids)
_task_idCmds=( _task_idCmds=(
'append:Appends more description to an existing task.' \ 'append' \
'prepend:Prepends more description to an existing task.' \ 'prepend' \
'annotate:Adds an annotation to an existing task.' \ 'annotate' \
'denotate:Deletes an annotation of an existing task.' \ 'denotate' \
'edit:Launches an editor to let you modify a task directly.' \ 'edit' \
'duplicate:Duplicates the specified task, and allows modifications.' \ 'duplicate' \
'info:Shows all data, metadata for specified task.' \ 'info' \
'start:Marks specified task as started.' \ 'start' \
'stop:Removes the start time from a task.' \ 'stop' \
'done:Marks the specified task as completed.' 'done'
) )
_task_idCmdsDesc=( _task_idCmdsDesc=(
@ -90,7 +87,7 @@ word=$'[^\0]#\0'
# priorities # priorities
local -a task_priorities local -a task_priorities
_regex_words task_prios 'task priorities' \ _regex_words values 'task priorities' \
'H:High' \ 'H:High' \
'M:Middle' \ 'M:Middle' \
'L:Low' 'L:Low'
@ -100,11 +97,11 @@ task_priorities=("$reply[@]")
local -a task_projects local -a task_projects
task_projects=( task_projects=(
/"$word"/ /"$word"/
":task_projects:task projects:compadd -a _task_projects" ":values:task projects:compadd -a _task_projects"
) )
local -a _task_dates local -a _task_dates
_regex_words _task_dates 'task dates' \ _regex_words values 'task dates' \
'tod*ay:Today' \ 'tod*ay:Today' \
'yes*terday:Yesterday' \ 'yes*terday:Yesterday' \
'tom*orrow:Tomorrow' \ 'tom*orrow:Tomorrow' \
@ -128,7 +125,7 @@ _regex_words _task_dates 'task dates' \
_task_dates=("$reply[@]") _task_dates=("$reply[@]")
local -a _task_reldates local -a _task_reldates
_regex_words _task_reldates 'task reldates' \ _regex_words values 'task reldates' \
'hrs:n hours' \ 'hrs:n hours' \
'day:n days' \ 'day:n days' \
'1st:first' \ '1st:first' \
@ -144,7 +141,7 @@ task_dates=(
\) \)
) )
_regex_words _task_freqs 'task frequencies' \ _regex_words values 'task frequencies' \
'daily:Every day' \ 'daily:Every day' \
'day:Every day' \ 'day:Every day' \
'weekdays:Every day skipping weekend days' \ 'weekdays:Every day skipping weekend days' \
@ -160,7 +157,7 @@ _regex_words _task_freqs 'task frequencies' \
_task_freqs=("$reply[@]") _task_freqs=("$reply[@]")
local -a _task_frequencies local -a _task_frequencies
_regex_words _task_frequencies 'task frequencies' \ _regex_words values 'task frequencies' \
'd:days' \ 'd:days' \
'w:weeks' \ 'w:weeks' \
'q:quarters' \ 'q:quarters' \
@ -175,7 +172,7 @@ task_freqs=(
# attributes # attributes
local -a task_attributes local -a task_attributes
_regex_words -t ':' task_attr 'task attributes' \ _regex_words -t ':' default 'task attributes' \
'pro*ject:Project name:$task_projects' \ 'pro*ject:Project name:$task_projects' \
'du*e:Due date:$task_dates' \ 'du*e:Due date:$task_dates' \
'wa*it:Date until task becomes pending:$task_dates' \ 'wa*it:Date until task becomes pending:$task_dates' \
@ -189,9 +186,9 @@ task_attributes=("$reply[@]")
args=( args=(
\( "$task_attributes[@]" \| \( "$task_attributes[@]" \|
\( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":task_mods:modifiers:compadd -S ':' -a _task_modifiers" \) \) \| \( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \|
\( /'(rc).'/- \( /$'[^:]#:'/ ":task_config:config:compadd -S ':' -a _task_config" \) \) \| \( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \|
\( /'(+|-)'/- \( /"$word"/ ":task_rtag:remove tag:compadd -a _task_tags" \) \) \| \( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \|
\( /"$word"/ \) \( /"$word"/ \)
\) \# \) \#
) )
@ -209,7 +206,9 @@ _task_default() {
(( $+functions[_task_id] )) || (( $+functions[_task_id] )) ||
_task_id() { _task_id() {
if (( CURRENT < 3 )); then 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 else
_task_attributes "$@" _task_attributes "$@"
fi fi
@ -218,9 +217,25 @@ _task_id() {
# merge completion # merge completion
(( $+functions[_task_merge] )) || (( $+functions[_task_merge] )) ||
_task_merge() { _task_merge() {
# TODO match URIs in .taskrc
_files _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 # modify (task [0-9]* ...) completion
(( $+functions[_task_modify] )) || (( $+functions[_task_modify] )) ||
_task_modify() { _task_modify() {
@ -233,21 +248,22 @@ _task_modify() {
_task_commands() { _task_commands() {
local cmd ret=1 local cmd ret=1
if (( CURRENT == 1 )); then 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 match more than one ID
# TODO sorting (ids below commands)
elif [[ $words[1] =~ ^[0-9]*$ ]] then elif [[ $words[1] =~ ^[0-9]*$ ]] then
_call_function ret _task_modify _call_function ret _task_modify
return ret return ret
else else
local curcontext="${curcontext}" # local curcontext="${curcontext}"
# cmd="${_task_cmds[(r)$words[1]:*]%%:*}" # cmd="${_task_cmds[(r)$words[1]:*]%%:*}"
cmd="${_task_cmds[(r)$words[1]]}" cmd="${_task_cmds[(r)$words[1]]}"
idCmd="${(M)_task_idCmds[@]:#$words[1]}" idCmd="${(M)_task_idCmds[@]:#$words[1]}"
if (( $#cmd )); then if (( $#cmd )); then
curcontext="${curcontext%:*:*}:task-${cmd}" # curcontext="${curcontext%:*:*}:task-${cmd}"
if (( $#idCmd )); then if (( $#idCmd )); then
_call_function ret _task_id _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 ())); Date dt (::atoi (created.c_str ()));
age = Duration (now - dt).formatCompact (); age = Duration (now - dt).formatCompact ();
context.hooks.trigger ("format-age_compact", "age_compact", age); context.hooks.trigger ("format-age_compact", "age_compact", age);
table.addCell (row, columnCount, age); table.addCell (row, columnCount, age);
} }