Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: Passsing descriptions down in completion functions



> 
> 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.
> 
> _hosts does roughly:
>   _wanted hosts expl host compadd "$@" -a hosts
> 
> 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.
> 
> 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.
> 
> 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.
> 

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




Messages sorted by: Reverse Date, Date, Thread, Author