zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: fmadm (solaris) completion
@ 2016-09-27 12:43 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2016-09-27 12:43 UTC (permalink / raw)
  To: Zsh workers

Apparently the list subcommand is the same as faulty so should accept -g
and -n options. Also, it needs to check $state otherwise the filename
fallback completion gets triggered when there is no subcommand.

Oliver

diff --git a/Completion/Solaris/Command/_fmadm b/Completion/Solaris/Command/_fmadm
index 2a28f7a..54e22bd 100644
--- a/Completion/Solaris/Command/_fmadm
+++ b/Completion/Solaris/Command/_fmadm
@@ -43,6 +43,7 @@ _arguments -C -A "-*" \
   '1:fmadm subcommand:compadd -M "r:|-=* r:|=*" -a subcmds' \
   '*::command:->subcmd' && ret=0
 
+[[ -z $state ]] && return ret
 service="$words[1]"
 curcontext="${curcontext%:*}-$service:"
 
@@ -59,14 +60,14 @@ case $service in
     )
   ;|
 
-  (faulty)
+  (list|faulty)
     _arguments -A "-*" $args \
       '-a[display all faults]' \
       '-g[group faults]' \
-      '-n[limit output to n entries]:number'
+      '-n[limit output to specified number of entries]:number'
   ;;
 
-  (list|list-alert|list-defect|list-fault)
+  (list-alert|list-defect|list-fault)
     _arguments -A "-*" $args \
       '-a[display all resources]'
   ;;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-27 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-27 12:43 PATCH: fmadm (solaris) completion Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).