diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2019-08-07 09:17:13 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2019-08-07 09:17:13 -0300 |
commit | 5732da2af736c40cf693354485446ab4867ecb4d (patch) | |
tree | 76d76cdfa16ca62d20fb109da13895ec64fff110 /completions/ulimit | |
parent | 9cd22d1df8f0f5b554858471c86faa9f37b8fed4 (diff) | |
download | bash-completion-5732da2af736c40cf693354485446ab4867ecb4d.tar.gz |
New upstream version 2.9upstream/2.9
Diffstat (limited to 'completions/ulimit')
-rw-r--r-- | completions/ulimit | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/completions/ulimit b/completions/ulimit new file mode 100644 index 00000000..3887cdf5 --- /dev/null +++ b/completions/ulimit @@ -0,0 +1,42 @@ +# bash completion for ulimit -*- shell-script -*- + +_ulimit() +{ + local cur prev words cword + _init_completion || return + + # TODO combined option support (-aH, -Sc etc) + + local mode + case $prev in + -a) + COMPREPLY=( $(compgen -W "-S -H" -- "$cur") ) + return + ;; + -[SH]) + ;; + -*) + mode=$prev + ;; + esac + + if [[ -z "$mode" ]]; then + local word + for word in "${words[@]}"; do + [[ $word == -*a* ]] && return + done + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + return + fi + fi + + local args + _count_args + [[ $args -eq 1 ]] && \ + COMPREPLY=( $(compgen -W "soft hard unlimited" -- "$cur") ) +} && +complete -F _ulimit ulimit + +# ex: filetype=sh |