diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2009-02-14 18:11:44 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2009-02-14 18:11:44 +0000 |
commit | 4ae72f2255de439682444d2e0d33eefa3f2796de (patch) | |
tree | d699783973b1a690571b33d5a600c35736d95f0c /Completion/Solaris/Command/_svccfg | |
parent | 3246dee5a25d47588ff36a9d6c429e2b091d9c7d (diff) | |
download | zsh-4ae72f2255de439682444d2e0d33eefa3f2796de.tar.gz zsh-4ae72f2255de439682444d2e0d33eefa3f2796de.tar.xz zsh-4ae72f2255de439682444d2e0d33eefa3f2796de.zip |
Danek Duvall: 26571: Additions for Solaris
Diffstat (limited to 'Completion/Solaris/Command/_svccfg')
-rw-r--r-- | Completion/Solaris/Command/_svccfg | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/Completion/Solaris/Command/_svccfg b/Completion/Solaris/Command/_svccfg index 59f275f26..5d1bf358a 100644 --- a/Completion/Solaris/Command/_svccfg +++ b/Completion/Solaris/Command/_svccfg @@ -1,9 +1,27 @@ #compdef svccfg +_svccfg_properties() { + local -a props fmris + local fmri="$argv[$#]" + + # If There's more than one possible FMRI, bail + fmris=( ${(f)"$(svcs -H -o fmri $fmri)"} ) + if [[ $#fmris -gt 1 ]]; then + _message "'$fmri' is ambiguous" + return 1 + fi + + # Get all the property names for the FMRI + props=( ${${${(f)"$(svccfg -s $fmri describe)"}:# *}%% *} ) + + _multi_parts "$expl[@]" - / props +} + _svccfg() { local context state line subcmds + typeset -A opt_args - subcmds=( apply extract import validate export inventory delete addpropvalue delpropvalue ) + subcmds=( apply describe extract import validate export inventory delete addpropvalue delpropvalue ) if [[ $service == "svccfg" ]]; then _arguments -s \ @@ -30,10 +48,14 @@ _svccfg() { ':file:_files' ;; - (apply|validate|inventory) + (apply|inventory) _files ;; + (validate) + _alternative 'files:file:_files' 'fmris:fmri:_svc_fmri -c' + ;; + (export) _svcs_fmri -c ;; @@ -44,6 +66,14 @@ _svccfg() { '*:FMRI:_svcs_fmri -c' ;; + (describe) + local fmri=$opt_args[-s] + _arguments -A "-*" \ + '-v[Give all information]' \ + '-t[Show only template data]' \ + ":property group or property:_svccfg_properties $fmri" + ;; + (extract) ;; |