X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=shell-completion%2Fbash%2Fsystemd-analyze;h=33833aac105f0c0351660dd6c13e14fe3da8d9a2;hb=a72d698d0d9ff9c158155b44cdc77376df31a317;hp=8a4453d4055d7639feaeae1e61ef09b4160eb1c9;hpb=83cb95b530ca5ae17bd9249774940840a4bbb667;p=elogind.git diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index 8a4453d40..33833aac1 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -19,9 +19,10 @@ # along with systemd; If not, see . __contains_word () { - local word=$1; shift - for w in $*; do [[ $w = $word ]] && return 0; done - return 1 + local w word=$1; shift + for w in "$@"; do + [[ $w = "$word" ]] && return + done } _systemd_analyze() { @@ -31,6 +32,7 @@ _systemd_analyze() { local -A VERBS=( [NO_OPTION]='time blame plot' + [CRITICAL_CHAIN]='critical-chain' [DOT]='dot' ) @@ -57,6 +59,11 @@ _systemd_analyze() { comps='--help --version --system --user' fi + elif __contains_word "$verb" ${VERBS[CRITICAL_CHAIN]}; then + if [[ $cur = -* ]]; then + comps='--help --version --system --user --fuzz' + fi + elif __contains_word "$verb" ${VERBS[DOT]}; then if [[ $cur = -* ]]; then comps='--help --version --system --user --from-pattern --to-pattern --order --require'