From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14972 invoked from network); 6 May 2000 06:56:33 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 May 2000 06:56:33 -0000 Received: (qmail 7080 invoked by alias); 6 May 2000 06:56:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11220 Received: (qmail 7071 invoked from network); 6 May 2000 06:56:25 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "Sven Wischnowsky" , Subject: RE: PATCH: Re: sudo completion problem Date: Sat, 6 May 2000 10:56:23 +0400 Message-ID: <000501bfb728$30dd2f40$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.2911.0) Importance: Normal In-Reply-To: <200005031442.QAA06892@beta.informatik.hu-berlin.de> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 > > Hm. From the logic of the specifications used by _sudo, this > completion is correct, after all, there may be options between > arguments unless otherwise specified. > > So this adds the special string `-' for exclusion lists which makes > the description for the options not be used any more. And it makes > this be used in the places where we have such _command_names/_normal > combinations. > No, that is wrong approach. As Zefram pointed out, the logic is: first argument terminates options. Anything after first argument must NOT be trated as option. Cf.: bor@itsrm2% diff .zshrc --r diff: Cannot access --r: No such file or directory This applies to *all* arguments cases, not just a case with _normal. Currently we get: bor@itsrm2% gdiff --brief .zshrc -r bor@itsrm2% gdiff --brief .zshrc -r Completing option -B -- ignore lines that are all blank -H -- assume large files and many small changes -I -- ignore lines that match regex ..... but in this case the ``--r'' is *argument* (== file) and not an option any more: bor@itsrm2% gdiff --brief .zshrc -r gdiff: missing operand gdiff: Try `gdiff --help' for more information. The weird is, that *long* options (at least in this case) are interpreted everywhere: bor@itsrm2% gdiff --brief .zshrc --r gdiff: option `--r' is ambiguous gdiff: Try `gdiff --help' for more information. In other words, what we need, is: - short options must be treated consistent with Unix. First non-option argument terminates short options. Because it is normal, default behaviour - I suggest reverting change for find (to avoid modifying *every* completion function) and - for rare cases, when arguments and options (or what looks like options - in case of find) can be intermixed - some way to express it is needed. Option for _arguments may be? - can somebody comment on long options case - is it expected behaviour? Note, that I mean in this case "GNU long options". In this case, again, _arguments should differentiate bewteen long and short case, again with option. There are enough commands out there that use "long" options but not GNU ones. -andrej