From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6092 invoked from network); 9 Jan 2003 15:10:06 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Jan 2003 15:10:06 -0000 Received: (qmail 25181 invoked by alias); 9 Jan 2003 15:10:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18065 Received: (qmail 25169 invoked from network); 9 Jan 2003 15:09:59 -0000 From: Borzenkov Andrey To: zsh-workers@sunsite.dk Subject: RE: Passsing descriptions down in completion functions Date: Thu, 9 Jan 2003 18:09:50 +0300 Message-ID: <6134254DE87BD411908B00A0C99B044F03A0B5CF@MOWD019A> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <32149.1042120127@finches.logica.co.uk> >=20 > compadd takes the first description on the line so a function like > _hosts needs to add any explanations after those that have been = passed > as arguments. >=20 > _hosts does roughly: > _wanted hosts expl host compadd "$@" -a hosts >=20 > which is turned into the compadd line you quoted above. The = explanation > arguments added by _wanted are inserted before a `-' argument so if = you > rewrite the last line of _hosts as: > _wanted hosts expl host compadd "$@" - $hosts > It will work. >=20 > The first bug (in my opinion) is that > _wanted hosts expl host compadd "$@" -a hosts - > does not work because any explanation arguments after the -a option = are > ignored. >=20 > The second bug is that there are loads of functions like _hosts which > don't use this `-' argument trick, mainly because the _wanted feature > was added later and nobody ever went through adding it to all the > existing functions. >=20 Sure, I understand that. We already discussed it and I still think that instead of modifying every completion function _all_labels should just = check for existing options and not add them (are there more than just -X? As = I understand the only options that can be modified by _all_labels are = those used for explanations. It does not look all that simple after reviewing _all_labels but it should be doable). The general question - should completion functions ever accept (be used with) other options than compadd? If not the above is perfectly valid = and probably more simple that modifying every single function. If yes, here = is the list of functions that use _wanted without '-'. AIX/Command/_smit AIX/Type/_object_classes Base/Completer/_expand_alias Base/Completer/_history Base/Utility/_sub_commands Debian/Command/_auto-apt Debian/Command/_bts Debian/Command/_debfoster Linux/Command/_modutils Mandrake/Command/_urpmi Redhat/Command/_rpm Unix/Command/_ant Unix/Command/_archie Unix/Command/_arp Unix/Command/_cdcd Unix/Command/_chkconfig Unix/Command/_chown Unix/Command/_cpio Unix/Command/_cvs Unix/Command/_gdb Unix/Command/_gprof Unix/Command/_iconv Unix/Command/_imagemagick Unix/Command/_java Unix/Command/_make Unix/Command/_man Unix/Command/_mh Unix/Command/_mtools Unix/Command/_mysql_utils Unix/Command/_ncftp Unix/Command/_nslookup Unix/Command/_pbm Unix/Command/_rcs Unix/Command/_rlogin Unix/Command/_rsync Unix/Command/_ruby Unix/Command/_samba Unix/Command/_sccs Unix/Command/_ssh Unix/Command/_stty Unix/Command/_tar Unix/Command/_telnet Unix/Command/_whois Unix/Command/_yp Unix/Command/_zip Unix/Type/_directories Unix/Type/_domains Unix/Type/_file_systems Unix/Type/_groups Unix/Type/_hosts Unix/Type/_java_class Unix/Type/_locales Unix/Type/_newsgroups Unix/Type/_perl_basepods Unix/Type/_perl_builtin_funcs Unix/Type/_perl_modules Unix/Type/_pids Unix/Type/_ports Unix/Type/_printers Unix/Type/_time_zone Unix/Type/_urls Unix/Type/_user_at_host Unix/Type/_users X/Command/_mozilla X/Command/_netscape X/Command/_xauth X/Type/_x_color X/Type/_x_cursor X/Type/_x_extension X/Type/_x_font X/Type/_x_keysym Zsh/Command/_alias Zsh/Command/_bindkey Zsh/Command/_builtin Zsh/Command/_cd Zsh/Command/_command Zsh/Command/_compdef Zsh/Command/_echotc Zsh/Command/_echoti Zsh/Command/_hash Zsh/Command/_unhash Zsh/Command/_zcompile Zsh/Command/_zftp Zsh/Command/_zle Zsh/Command/_zpty Zsh/Command/_zstyle Zsh/Context/_equal Zsh/Context/_subscript Zsh/Context/_value Zsh/Type/_arrays Zsh/Type/_directory_stack Zsh/Type/_file_descriptors Zsh/Type/_functions Zsh/Type/_limits Zsh/Type/_options Zsh/Type/_options_set Zsh/Type/_options_unset -andrey