From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20351 invoked from network); 14 Sep 1999 09:57:13 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Sep 1999 09:57:13 -0000 Received: (qmail 475 invoked by alias); 14 Sep 1999 09:56:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7824 Received: (qmail 468 invoked from network); 14 Sep 1999 09:56:47 -0000 Date: Tue, 14 Sep 1999 11:56:44 +0200 (MET DST) Message-Id: <199909140956.LAA26998@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Mon, 13 Sep 1999 15:45:16 +0200 (MET DST) Subject: Re: Completion listing of command options ( Re: Size of select listing?) 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') 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