summaryrefslogtreecommitdiffstats
path: root/completions/ulimit
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf2621414ee5f2f601424c22f00e207903e3b6104 (patch)
tree56a856dafd1ca684bb23263cacaa723ee4f404fc /completions/ulimit
parentAdding debian version 1:2.11-8. (diff)
downloadbash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz
bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.zip
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/ulimit')
-rw-r--r--completions/ulimit21
1 files changed, 9 insertions, 12 deletions
diff --git a/completions/ulimit b/completions/ulimit
index e596bf7..9f6f13b 100644
--- a/completions/ulimit
+++ b/completions/ulimit
@@ -1,16 +1,16 @@
# bash completion for ulimit -*- shell-script -*-
-_ulimit()
+_comp_cmd_ulimit()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
# TODO combined option support (-aH, -Sc etc)
- local mode
+ local mode=
case $prev in
-a)
- COMPREPLY=($(compgen -W "-S -H" -- "$cur"))
+ _comp_compgen -- -W "-S -H"
return
;;
-[SH]) ;;
@@ -20,23 +20,20 @@ _ulimit()
;;
esac
- if [[ ! -v mode ]]; then
+ if [[ ! $mode ]]; then
local word
for word in "${words[@]}"; do
[[ $word == -*a* ]] && return
done
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur"))
+ _comp_compgen_usage -c help -s "$1"
return
fi
fi
- local args
- _count_args
- ((args == 1)) &&
- COMPREPLY=($(compgen -W "soft hard unlimited" -- "$cur"))
+ [[ ${mode-} ]] && _comp_compgen -- -W "soft hard unlimited"
} &&
- complete -F _ulimit ulimit
+ complete -F _comp_cmd_ulimit ulimit
# ex: filetype=sh