zsh-completion: _rc-service support extra actions

- use rc-service <service> describe to get action list

This is for #285.
This commit is contained in:
Felix Neumärker 2019-01-18 23:20:38 +01:00 committed by William Hubbs
parent 77f09900a2
commit 3eef6e9127

View File

@ -14,7 +14,12 @@ _rc_actions() {
if [[ -n "${opt_args[(i)-e|--exists|-r|--resolve]}" ]] || ! $(rc-service -e $service) ; then
_nothing
else
_values 'action' stop start restart describe zap
local -a actions=(${(f)"$(rc-service -C $service describe 2>&1)"})
shift actions
actions=(${actions# \* })
actions=(${actions/:*})
actions=(stop start restart describe zap ${actions[@]})
_describe -V 'action' actions
fi
}