From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10352 invoked from network); 10 Sep 1999 13:23:23 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 Sep 1999 13:23:23 -0000 Received: (qmail 21917 invoked by alias); 10 Sep 1999 13:23:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7766 Received: (qmail 21910 invoked from network); 10 Sep 1999 13:23:13 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer thoth.mch.sni.de) From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: Problem with _arguments and invalid options Date: Fri, 10 Sep 1999 17:23:08 +0400 Message-ID: <000b01befb8f$9f2f87e0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Currently, invalid (not listed in description) options are not handled very nicely. Here is half-hearted example of sudo completion: _arguments \ '-V[show version]' \ '-l[list commands]' \ '-h[show help]' \ '-v[validate timestamp file]' \ '-k[remove timestamp file]' \ '-b[run command in background]' \ '-r:Kerberos realm:' \ '-p:prompt:' \ '-u:user name:_users' \ '-s[run SHELL]' \ '-H[set HOME environment variable]' \ '*::complete command and/or arguments:_normal' And now bor@itsrm2:~/.zsh.d/completion%> sudo -z TAB bor@itsrm2:~/.zsh.d/completion%> sudo -z _normal: bad option: -z [33] _ --- file _sudo _umount What's worse - if a command does not list `-s', but you *do* give `-s' - it seems to be propagated downward and interpreted by _arguments itself (or some other function, dunno). Just remove definition for -s from above and try: bor@itsrm2:~/.zsh.d/completion%> sudo -u nTAB bor@itsrm2:~/.zsh.d/completion%> sudo -u n --- user nerv nobody nuucp but bor@itsrm2:~/.zsh.d/completion%> sudo -s -u nTAB B-e-e-p and bor@itsrm2:~/.zsh.d/completion%> sudo -s -u TAB bor@itsrm2:~/.zsh.d/completion%> sudo -s -u _ --- file _sudo _umount /andrej