From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10971 invoked from network); 4 Apr 2000 10:27:41 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Apr 2000 10:27:41 -0000 Received: (qmail 29299 invoked by alias); 4 Apr 2000 10:27:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10457 Received: (qmail 29204 invoked from network); 4 Apr 2000 10:27:13 -0000 To: zsh-workers@sunsite.auc.dk Subject: _arguments questions X-Attribution: adl From: Alexandre Duret-Lutz Date: 04 Apr 2000 12:24:31 +0200 Message-ID: User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi. I have some troubles with nested `_arguments'... _foo () { _arguments -c -d -e } _test () { _arguments -a -b '-c:*::blah: _foo' } The wanted behaviour is that any arguments given after the first `-c' shall complete to `-c', `-d', or `-e'. Unfortunately: phobos% compdef _test test phobos% test -c - -a -b Strange. Tracing trough the code, I found that the call to `_arguments' in `_foo' returned 1 because `compargument -i' ensures that CURRENT > 1. Indeed, if I add a dummy option after the first `-c' it completes right : phobos% test -c -dummy - -c -d -e Then, I can try to add this dummy word automatically : _bar () { words=(dummy $words) (( ++CURRENT )) _foo } _test () { _arguments -a -b '-c:*::blah: _bar' } But the behaviour is now phobos% test -c - -a -b -c -d -e with unwanted `-a' and `-b'. And after the first option I get phobos% test -c -d - -c -e which is correct. So questions are 1) is there a simplier way to nest `_arguments' ? 2) how to suppress those unwanted `-a' and `-b' ? -- Alexandre Duret-Lutz