zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: fmadm (solaris) completion
Date: Tue, 27 Sep 2016 14:43:40 +0200	[thread overview]
Message-ID: <25528.1474980220@hydra.kiddle.eu> (raw)

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]'
   ;;


                 reply	other threads:[~2016-09-27 12:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25528.1474980220@hydra.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).