From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11141 invoked from network); 9 Sep 1999 14:27:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Sep 1999 14:27:31 -0000 Received: (qmail 15468 invoked by alias); 9 Sep 1999 14:27:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7750 Received: (qmail 15461 invoked from network); 9 Sep 1999 14:27:15 -0000 Date: Thu, 9 Sep 1999 16:27:12 +0200 (MET DST) Message-Id: <199909091427.QAA03152@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Thu, 9 Sep 1999 18:05:11 +0400 Subject: RE: Silly questions about _arguments & Co (and probably bugs) Andrej Borsenkow wrote: > > > 2. Looks, like `-s' is overloaded - it is used both for "single > > letter options" > > > and for "option aliases" (from _long_options). I believe, this is > > the reason why > > > option aliases do not work any more :-) E.g. ntpd configure lists > > only --enable > > > variant - and now no --disable counterparts are recognised. > > > > No, the `-s' for the long-option stuff is *only* interpreted if it > > appears *after* the `--', which needs to be there to make `_arguments' > > do this automatic-long-option-stuff at all. The `-s' for `use single > > letter options' has to come as the *first* argument. > > O.K., I overlooked it (not that I like it either). The alternative would be to have an option that says that `cmd --help' should be called and to have a (yet another) syntax for the long-option- patterns/descriptions. This would make parsing a bit slower and since these descriptions are used in a completely different way than the other descriptions they should be grouped together anyway (I think). But if enough people complain... > But, still, aliasing does not > work any more. Just try > > ./configure --dis-z-m > > It should complete to --disable-zsh-memory - but it does not. Yep, should be fixed with the patch below. Bye Sven diff -u oldcompletion/Base/_arguments Completion/Base/_arguments --- oldcompletion/Base/_arguments Thu Sep 9 16:12:19 1999 +++ Completion/Base/_arguments Thu Sep 9 16:22:33 1999 @@ -57,6 +57,8 @@ # We have to build the long-option cache anew, get the `-i' and # `-s' options. + set -- "${(@)argv[nth+1,-1]}" + iopts=() sopts=() while [[ "$1" = -[is]* ]]; do @@ -105,7 +107,7 @@ # ... and add "same" options while (( $#sopts )); do - lopts=( $lopts ${opts/$sopts[1]/$sopts[2]} ) + lopts=( $lopts ${lopts/$sopts[1]/$sopts[2]} ) shift 2 sopts done -- Sven Wischnowsky wischnow@informatik.hu-berlin.de