about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/_arguments13
1 files changed, 11 insertions, 2 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 1e1787b19..a25e8ded1 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -628,8 +628,11 @@ if [[ -z "$def" || "$def" = :* ]]; then
       [[ -n "$inrest" ]] && opt=''
     fi
     if [[ -z "$def" ]]; then
-      _message 'no more arguments'
-      noargs=yes
+      if [[ -z "$args$rest" ]]; then
+        noargs='no arguments'
+      else
+        noargs='no more arguments'
+      fi
     fi
   fi
 
@@ -651,6 +654,7 @@ if [[ -z "$def" || "$def" = :* ]]; then
 	for i in ${(s::)prefix[2,-1]%%${tmp[1][2]}*} ${tmp[1][2]}; do
 	  _options[${prefix[1]}$i]=''
 	done
+	noargs=''
 	break
       elif compset -P "$tmp[1]"; then
 
@@ -659,6 +663,7 @@ if [[ -z "$def" || "$def" = :* ]]; then
 
 	def="$dopts[$tmp[1]]"
 	opt=''
+	noargs=''
 	break
       fi
       shift 1 tmp
@@ -675,10 +680,12 @@ if [[ -z "$def" || "$def" = :* ]]; then
 	for i in ${(s::)prefix[2,-1]%%${tmp[1][2]}*} ${tmp[1][2]}; do
 	  _options[${prefix[1]}$i]=''
 	done
+	noargs=''
 	break
       elif compset -P "$tmp[1]"; then
 	def="$odopts[$tmp[1]]"
 	opt=''
+	noargs=''
 	break
       fi
       shift 1 tmp
@@ -914,6 +921,8 @@ while true; do
   break
 done
 
+[[ -n "$noargs" ]] && _message "$noargs"
+
 [[ -n "$aret" ]] && return 300
 
 # Set the return value.