summaryrefslogtreecommitdiffstats
path: root/completions/crontab
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
commit6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch)
tree0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /completions/crontab
parentReleasing progress-linux version 1:2.11-8~progress7.99u1. (diff)
downloadbash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.tar.xz
bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.zip
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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