summaryrefslogtreecommitdiffstats
path: root/completions/crontab
diff options
context:
space:
mode:
Diffstat (limited to 'completions/crontab')
-rw-r--r--completions/crontab24
1 files changed, 12 insertions, 12 deletions
diff --git a/completions/crontab b/completions/crontab
index cac7853..4f80347 100644
--- a/completions/crontab
+++ b/completions/crontab
@@ -1,13 +1,13 @@
# crontab(1) completion -*- shell-script -*-
-_crontab()
+_comp_cmd_crontab()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
case $prev in
-*u)
- _allowed_users
+ _comp_compgen_allowed_users
return
;;
esac
@@ -18,31 +18,31 @@ _crontab()
local i
for i in "${!words[@]}"; do
- [[ ${words[i]} && $i -ne $cword ]] && unset "opts[${words[i]}]"
+ [[ ${words[i]} && $i -ne $cword ]] && unset -v "opts[${words[i]}]"
case "${words[i]}" in
-l)
- unset 'opts[-r]' 'opts[-e]' 'opts[-i]' 'opts[-s]'
+ unset -v 'opts[-r]' 'opts[-e]' 'opts[-i]' 'opts[-s]'
;;
-e)
- unset 'opts[-l]' 'opts[-r]' 'opts[-i]'
+ unset -v 'opts[-l]' 'opts[-r]' 'opts[-i]'
;;
-r)
- unset 'opts[-l]' 'opts[-e]'
+ unset -v 'opts[-l]' 'opts[-e]'
;;
-u)
- unset 'opts[-i]'
+ unset -v 'opts[-i]'
;;
esac
done
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '${!opts[@]}' -- "$cur"))
+ _comp_compgen -- -W '"${!opts[@]}"'
return
fi
# do filenames only if we did not have -l, -r, or -e
- [[ ${words[*]} == *\ -[lre]* ]] || _filedir
+ [[ ${words[*]} == *\ -[lre]* ]] || _comp_compgen_filedir
} &&
- complete -F _crontab crontab
+ complete -F _comp_cmd_crontab crontab
# ex: filetype=sh