From 9d4028ff86caeb90302c8457649c33ca597e88ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sat, 7 Jan 2023 04:30:18 +0000 Subject: [PATCH] waitpid: adapt bash-completion for current functionality --- bash-completion/waitpid | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) 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 -- 2.47.3