Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: fmadm (solaris) completion
- X-seq: zsh-workers 39464
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: fmadm (solaris) completion
- Date: Tue, 27 Sep 2016 14:43:40 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1474980221; bh=Xfpmtc43dxrZiIXMxZ7xSn7Z/YYNiiKsX/j8KSWUQMs=; h=From:To:Subject:Date:From:Subject; b=JnfGy4eyi5szs2dQsdYkurxROC9MAUg2THx9z0716aCivCdWyzI0DgYYbhO1SAIToNk4KmraPVQas07VqlMdzmf7qEcqnyeiecUR53zzCEsp9WEmOKBoEODvlwnOOdYrv4YHfggQhR5AH9NtNlq3qYew2hBUefvV+Xubpz9zHVGcjv9UC18ylycB9TXpSemgihA+RKhPwqgc5Boq7ERJhD5ljWj785RYzgpJZm40el8zgQBtuir1os0VT0G097Z1hYekMJ1aMlBZT3wlQK1uPva4gC17KmZdrTrrA++/6ZN08x4qwN2GWPgMREubv+XbWoj+iqWa4kZt6gj63XV98Q==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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]'
;;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author