From 4ae72f2255de439682444d2e0d33eefa3f2796de Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 14 Feb 2009 18:11:44 +0000 Subject: Danek Duvall: 26571: Additions for Solaris --- Completion/Solaris/Command/_svccfg | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'Completion/Solaris/Command/_svccfg') 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) ;; -- cgit 1.4.1