zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Completion listing of command options ( Re: Size of select listing?)
Date: Tue, 14 Sep 1999 11:56:44 +0200 (MET DST)	[thread overview]
Message-ID: <199909140956.LAA26998@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Mon, 13 Sep 1999 15:45:16 +0200 (MET DST)


I wrote:

> This makes `_arguments' spit out a message saying `no more arguments'
> in such command line positions. Is that OK for everyone?

This makes it a bit nicer:

- don't unconditionally turn on listing in `_message'
- display `no arguments' or `no more arguments' depending on whether
  the command takes normal arguments at all
- don't display the message if completing after an option (e.g. `rpm -b<TAB>')

Bye
 Sven

diff -u -r oldcompletion/Base/_arguments Completion/Base/_arguments
--- oldcompletion/Base/_arguments	Tue Sep 14 10:19:44 1999
+++ Completion/Base/_arguments	Tue Sep 14 11:43:57 1999
@@ -628,8 +628,11 @@
       [[ -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 @@
 	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 @@
 
 	def="$dopts[$tmp[1]]"
 	opt=''
+	noargs=''
 	break
       fi
       shift 1 tmp
@@ -675,10 +680,12 @@
 	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
@@ -913,6 +920,8 @@
 
   break
 done
+
+[[ -n "$noargs" ]] && _message "$noargs"
 
 [[ -n "$aret" ]] && return 300
 
diff -u -r oldcompletion/Core/_message Completion/Core/_message
--- oldcompletion/Core/_message	Tue Sep 14 09:09:07 1999
+++ Completion/Core/_message	Tue Sep 14 11:55:32 1999
@@ -10,8 +10,8 @@
     compstate[list]=list
     compstate[insert]=''
     compadd -UX "${format//\\%d/$1}" -n ''
+    compstate[force_list]=yes
   else
-    compadd -X "${format//\\%d/$1}" -n ''
+    compadd -X "${format//\\%d/$1}" -n '' && compstate[force_list]=yes
   fi
-  compstate[force_list]=yes
 fi

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1999-09-14  9:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-14  9:56 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-09-13 13:45 Sven Wischnowsky
1999-09-13  8:34 Sven Wischnowsky
1999-09-09 15:19 Size of select listing? Andrej Borsenkow
1999-09-10 15:23 ` Oliver Kiddle
1999-09-10 15:45   ` Completion listing of command options (Re: Size of select listing?) Bart Schaefer
1999-09-10 15:54   ` Completion listing of command options ( " Andrej Borsenkow

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=199909140956.LAA26998@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).