From: Thomas Weißschuh Date: Sat, 7 Jan 2023 04:30:18 +0000 (+0000) Subject: waitpid: adapt bash-completion for current functionality X-Git-Tag: v2.39-rc1~172^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d4028ff86caeb90302c8457649c33ca597e88ee;p=thirdparty%2Futil-linux.git waitpid: adapt bash-completion for current functionality --- diff --git a/bash-completion/waitpid b/bash-completion/waitpid index 762c30d711..67601bb8f7 100644 --- a/bash-completion/waitpid +++ b/bash-completion/waitpid @@ -1 +1,33 @@ -complete -F _pids waitpid +_waitpid_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-t'|'--timeout') + COMPREPLY=( $(compgen -W "seconds" -- $cur) ) + return 0 + ;; + '-h'|'--help'|'-V'|'--version') + return 0 + ;; + esac + case $cur in + -*) + OPTS="--verbose + --timeout + --exited + --help + --version" + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + *) + _pids + return 0 + ;; + esac + return 0 +} +complete -F _waitpid_module waitpid