summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-09-30 09:56:19 +0200
committerOliver Kiddle <opk@zsh.org>2016-09-30 09:56:19 +0200
commit01f9e54c579cf17fae754b58247d071a22f2d836 (patch)
tree0958852a71d9c166b060edb6b7949234b8882d85
parent736eb433bae71a162f8b5adbd42710bb718a3c91 (diff)
downloadzsh-01f9e54c579cf17fae754b58247d071a22f2d836.tar.gz
zsh-01f9e54c579cf17fae754b58247d071a22f2d836.tar.xz
zsh-01f9e54c579cf17fae754b58247d071a22f2d836.zip
39464: fix where lack of $state check caused unwanted filename completion for fmadm
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Solaris/Command/_fmadm7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3fe3165ed..d401a0aa2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-30  Oliver Kiddle  <opk@zsh.org>
+
+	* 39464: Completion/Solaris/Command/_fmadm: fix where lack
+	of $state check caused unwanted filename completion
+
 2016-09-29  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 39507: Doc/Zsh/params.yo, Src/exec.c: TMPSUFFIX for =(...)
diff --git a/Completion/Solaris/Command/_fmadm b/Completion/Solaris/Command/_fmadm
index 2a28f7a5c..54e22bde4 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]'
   ;;