diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
commit | b09f4483416c54c1782824633dfabaf2ec0265b6 (patch) | |
tree | 304bc82642862525ae680c7fbaa249663b10ad57 /Completion/Solaris/Command/_svcadm | |
parent | 12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff) | |
parent | 6e55c920503071e917619b8cb1a188cd35d772db (diff) | |
download | zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip |
New upstream version 5.8.1.2-test
Diffstat (limited to 'Completion/Solaris/Command/_svcadm')
-rw-r--r-- | Completion/Solaris/Command/_svcadm | 129 |
1 files changed, 63 insertions, 66 deletions
diff --git a/Completion/Solaris/Command/_svcadm b/Completion/Solaris/Command/_svcadm index c9826f2eb..22780d03f 100644 --- a/Completion/Solaris/Command/_svcadm +++ b/Completion/Solaris/Command/_svcadm @@ -1,78 +1,75 @@ #compdef svcadm -_svcadm() { - local curcontext="$curcontext" state line expl subcmds - typeset -A opt_args +local curcontext="$curcontext" state line expl subcmds +typeset -A opt_args - subcmds=( enable disable restart refresh mark delegate clear milestone ) +subcmds=( enable disable restart refresh mark delegate clear milestone ) - if [[ $service == "svcadm" ]]; then - _arguments -C -A "-*" \ - '-v[Print actions verbosely]' \ - '*::command:->subcmd' && return 0 +if [[ $service == "svcadm" ]]; then + _arguments -C -A "-*" \ + '-v[print actions verbosely]' \ + '*::command:->subcmd' && return 0 - if (( CURRENT == 1 )); then - _wanted commands expl 'svcadm subcommand' compadd -a subcmds - return - fi - service="$words[1]" - curcontext="${curcontext%:*}=$service:" - fi + if (( CURRENT == 1 )); then + _wanted commands expl 'svcadm subcommand' compadd -a subcmds + return + fi + service="$words[1]" + curcontext="${curcontext%:*}-$service:" +fi - case $service in - (enable) - _arguments -A "-*" \ - '-r[Recursively enable dependencies]' \ - '-s[Wait for service to come online]' \ - '-T[Timeout for -s]:seconds:' \ - '-t[State change is temporary]' \ - '*:instance FMRI:_svcs_fmri -i' - ;; +case $service in + (enable) + _arguments -A "-*" \ + '-r[recursively enable dependencies]' \ + '-s[wait for service to come online]' \ + '-T[timeout for -s]:timeout (seconds)' \ + '-t[state change is temporary]' \ + '*:instance FMRI:_svcs_fmri -i' + ;; - (disable) - _arguments -A "-*" \ - '-s[Wait for service to become disabled]' \ - '-T[Timeout for -s]:seconds:' \ - '-t[State change is temporary]' \ - '*:instance FMRI:_svcs_fmri -i' - ;; + (disable) + _arguments -A "-*" \ + '-s[wait for service to become disabled]' \ + '-T[timeout for -s]:timeout (seconds)' \ + '-t[state change is temporary]' \ + '*:instance FMRI:_svcs_fmri -i' + ;; - (mark) - _arguments -A "-*" \ - '-I[Change state immediately]' \ - "-s[Wait for service to reach the new state]" \ - '-T[Timeout for -s]:seconds:' \ - '-t[State change is temporary]' \ - ':state:(degraded maintenance)' \ - ':instance FMRI:_svcs_fmri -i' - ;; + (mark) + _arguments -A "-*" \ + '-I[change state immediately]' \ + "-s[wait for service to reach the new state]" \ + '-T[timeout for -s]:timeout (seconds)' \ + '-t[state change is temporary]' \ + ':state:(degraded maintenance)' \ + ':instance FMRI:_svcs_fmri -i' + ;; - (restart|refresh|clear) - _arguments \ - "-s[Wait for service to $service]" \ - '-T[Timeout for -s]:seconds:' \ - '*:instance FMRI:_svcs_fmri -i' - ;; + (restart|refresh|clear) + _arguments \ + "-s[wait for service to $service]" \ + '-T[timeout for -s]:timeout (seconds)' \ + '*:instance FMRI:_svcs_fmri -i' + ;; - (delegate) - _arguments -A "-*" \ - '-s[Wait for instances to come online]' \ - '-T[Timeout for -s]:seconds:' \ - ':restarter FMRI:_svcs_fmri -r' \ - '*:FMRI:_svcs_fmri -i' - ;; + (delegate) + _arguments -A "-*" \ + '-s[wait for instances to come online]' \ + '-T[timeout for -s]:timeout (seconds)' \ + ':restarter FMRI:_svcs_fmri -r' \ + '*:FMRI:_svcs_fmri -i' + ;; - (milestone) - _arguments -A "-*" \ - '-d[Make milestone the default]' \ - '-s[Wait for the transition to the new milestone]' \ - '-T[Timeout for -s]:seconds:' \ - '*:milestone FMRI:_svcs_fmri -m' - ;; + (milestone) + _arguments -A "-*" \ + '-d[make milestone the default]' \ + '-s[wait for the transition to the new milestone]' \ + '-T[timeout for -s]:timeout (seconds)' \ + '*:milestone FMRI:_svcs_fmri -m' + ;; - (*) - _message "unknown svcadm subcommand: $service" - esac -} - -_svcadm "$@" + (*) + _message "unknown svcadm subcommand: $service" + ;; +esac |