mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Fix fish completion (#3068)
* Fix fish completions As per [1] printf in fish does not support '--' as a delimiter of format string and args. It used to work (accidentally) earlier (fish 3.5, glibc 2.31) but it is broken (fish 3.6, glibc 2.36) nowadays. Fix it by using the simple form of printf invocation with no argument escaping. Fixes: #3048 [1] https://fishshell.com/docs/current/cmds/printf.html#description * Fix fish completions with older fish Older versions (fish 3.5) cannot cope with '-' in printf format hence add a workaround for these.
This commit is contained in:
parent
76b21f49e8
commit
3248437326
1 changed files with 12 additions and 11 deletions
|
@ -295,8 +295,9 @@ end
|
||||||
|
|
||||||
function __fish.task.list.tag
|
function __fish.task.list.tag
|
||||||
set -l tags (task _tags)
|
set -l tags (task _tags)
|
||||||
printf -- '+%s\n' $tags
|
printf '+%s\n' $tags
|
||||||
printf -- '-%s\n' $tags
|
# compatibility, older fish won't allow - in format
|
||||||
|
printf ' %s\n' $tags | tr ' ' '-'
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish.task.list.task
|
function __fish.task.list.task
|
||||||
|
@ -354,10 +355,10 @@ end
|
||||||
# static variables that won't changes even when taskw's data is modified
|
# static variables that won't changes even when taskw's data is modified
|
||||||
set __fish_task_static_commands_with_desc (__fish.task.zsh commands | sort | string collect)
|
set __fish_task_static_commands_with_desc (__fish.task.zsh commands | sort | string collect)
|
||||||
set __fish_task_static_commands (echo -e $__fish_task_static_commands_with_desc | cut -d ' ' -f 1 | string collect)
|
set __fish_task_static_commands (echo -e $__fish_task_static_commands_with_desc | cut -d ' ' -f 1 | string collect)
|
||||||
set __fish_task_static_command_mods (printf -- '%s\n' 'add' 'annotate' 'append' 'delete' 'done' 'duplicate' 'log' 'modify' 'prepend' 'start' 'stop' | string collect)
|
set __fish_task_static_command_mods (printf '%s\n' 'add' 'annotate' 'append' 'delete' 'done' 'duplicate' 'log' 'modify' 'prepend' 'start' 'stop' | string collect)
|
||||||
set __fish_task_static_mod (printf -- '%s\n' 'before' 'after' 'over' 'under' 'none' 'is' 'isnt' 'has' 'hasnt' 'startswith' 'endswith' 'word' 'noword' | string collect)
|
set __fish_task_static_mod (printf '%s\n' 'before' 'after' 'over' 'under' 'none' 'is' 'isnt' 'has' 'hasnt' 'startswith' 'endswith' 'word' 'noword' | string collect)
|
||||||
set __fish_task_static_status (printf -- '%s\tstatus\n' 'pending' 'completed' 'deleted' 'waiting' | string collect)
|
set __fish_task_static_status (printf '%s\tstatus\n' 'pending' 'completed' 'deleted' 'waiting' | string collect)
|
||||||
set __fish_task_static_priority (printf -- '%s\n' 'H\tHigh' 'M\tMiddle' 'L\tLow' | string collect)
|
set __fish_task_static_priority (printf '%s\n' 'H\tHigh' 'M\tMiddle' 'L\tLow' | string collect)
|
||||||
|
|
||||||
set __fish_task_static_freq 'daily:Every day' \
|
set __fish_task_static_freq 'daily:Every day' \
|
||||||
'day:Every day' \
|
'day:Every day' \
|
||||||
|
@ -372,17 +373,17 @@ set __fish_task_static_freq 'daily:Every day' \
|
||||||
'yearly:Every year' \
|
'yearly:Every year' \
|
||||||
'biannual:Every two years' \
|
'biannual:Every two years' \
|
||||||
'biyearly:Every two years'
|
'biyearly:Every two years'
|
||||||
set __fish_task_static_freq (printf -- '%s\n' $__fish_task_static_freq | sed 's/:/\t/' | string collect)
|
set __fish_task_static_freq (printf '%s\n' $__fish_task_static_freq | sed 's/:/\t/' | string collect)
|
||||||
set __fish_task_static_freq_numeric 'd:days' \
|
set __fish_task_static_freq_numeric 'd:days' \
|
||||||
'w:weeks' \
|
'w:weeks' \
|
||||||
'q:quarters' \
|
'q:quarters' \
|
||||||
'y:years'
|
'y:years'
|
||||||
set __fish_task_static_freq_numeric (printf -- '%s\n' $__fish_task_static_freq_numeric | sed 's/:/\t/' | string collect)
|
set __fish_task_static_freq_numeric (printf '%s\n' $__fish_task_static_freq_numeric | sed 's/:/\t/' | string collect)
|
||||||
set __fish_task_static_freq_numeric 'd:days' \
|
set __fish_task_static_freq_numeric 'd:days' \
|
||||||
'w:weeks' \
|
'w:weeks' \
|
||||||
'q:quarters' \
|
'q:quarters' \
|
||||||
'y:years'
|
'y:years'
|
||||||
set __fish_task_static_freq_numeric (printf -- '%s\n' $__fish_task_static_freq_numeric | sed 's/:/\t/' | string collect)
|
set __fish_task_static_freq_numeric (printf '%s\n' $__fish_task_static_freq_numeric | sed 's/:/\t/' | string collect)
|
||||||
set __fish_task_static_dates 'today:Today' \
|
set __fish_task_static_dates 'today:Today' \
|
||||||
'yesterday:Yesterday' \
|
'yesterday:Yesterday' \
|
||||||
'tomorrow:Tomorrow' \
|
'tomorrow:Tomorrow' \
|
||||||
|
@ -414,7 +415,7 @@ set __fish_task_static_dates 'today:Today' \
|
||||||
'midsommarafton:Midsommarafton' \
|
'midsommarafton:Midsommarafton' \
|
||||||
'later:Later' \
|
'later:Later' \
|
||||||
'someday:Some Day'
|
'someday:Some Day'
|
||||||
set __fish_task_static_dates (printf -- '%s\n' $__fish_task_static_dates | sed 's/:/\t/' | string collect)
|
set __fish_task_static_dates (printf '%s\n' $__fish_task_static_dates | sed 's/:/\t/' | string collect)
|
||||||
set __fish_task_static_reldates 'hrs:n hours' \
|
set __fish_task_static_reldates 'hrs:n hours' \
|
||||||
'day:n days' \
|
'day:n days' \
|
||||||
# '1st:first' \
|
# '1st:first' \
|
||||||
|
@ -422,7 +423,7 @@ set __fish_task_static_reldates 'hrs:n hours' \
|
||||||
# '3rd:third' \
|
# '3rd:third' \
|
||||||
# 'th:4th, 5th, etc.' \
|
# 'th:4th, 5th, etc.' \
|
||||||
'wks:weeks'
|
'wks:weeks'
|
||||||
set __fish_task_static_reldates (printf -- '%s\n' $__fish_task_static_reldates | sed 's/:/\t/' | string collect)
|
set __fish_task_static_reldates (printf '%s\n' $__fish_task_static_reldates | sed 's/:/\t/' | string collect)
|
||||||
# the followings are actually not used for autocomplete, but to retrieve friendly description that aren't present in internal command
|
# the followings are actually not used for autocomplete, but to retrieve friendly description that aren't present in internal command
|
||||||
set __fish_task_static_attr_desc_keys 'description' 'status' 'project' \
|
set __fish_task_static_attr_desc_keys 'description' 'status' 'project' \
|
||||||
'priority' 'due' 'recur' \
|
'priority' 'due' 'recur' \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue