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

Re: PATCH: Re: (forw) --help able programs and completion]



On Jun 27,  3:18pm, Sven Wischnowsky wrote:
} Subject: PATCH: Re: (forw) --help able programs and completion]
}
} Hm. Ok, ok. Here is a patchlet that also tries to emphasize compdef
} because this is almost becoming a FAQ.

Thanks for writing the text, but everything else in that section is
alphabetized now.

This moves _use_lo into alphabetical order and also creates a separate
(very short) entry for _files in its correct alphabetical location.  (It's
easier to search for that way, in the info browser.)

Index: Doc/Zsh/compsys.yo
===================================================================
@@ -2687,25 +2687,6 @@
 Like tt(_tags) this function supports the tt(-C) option to give a
 different name for the argument context field.
 )
-findex(_use_lo)
-item(tt(_use_lo))(
-This function is a simple wrapper around the tt(_arguments) function
-described below.  It can be used to automatically complete long
-options for commands that understand the `tt(-)tt(-help)' option
-(`tt(_use_lo)' is for `use long options').  It is not intended to be
-used from completion functions but as a top-level completion function
-in its own right.  For example, to enable option completion for the
-commands tt(foo) and tt(bar), one would call:
-
-example(compdef _use_lo foo bar)
-
-in one of the initialization files after the call to tt(compinit).
-
-The default installation uses this function only to generate
-completions for some GNU-commands because to complete the options, the 
-command has to be called and hence it shouldn't be used if one can't
-be sure that the command understands the `tt(-)tt(-help)' option.
-)
 findex(_arguments)
 item(tt(_arguments) var(spec) ...)(
 This function can be used to complete words on the line by describing the
@@ -3279,6 +3260,16 @@
 a similar format; this ensures that user-specified styles are correctly
 passed down to the builtins which implement the internals of completion.
 )
+findex(_files)
+item(tt(_files))(
+The function tt(_files) uses the tt(file-patterns) style and calls
+tt(_path_files) with all the arguments it was passed except for tt(-g) 
+and tt(-/).  These two options are used depending on the setting of the 
+tt(file-patterns) style.
+
+See tt(_path_files) below for a description of the full set of options
+accepted by tt(_files).
+)
 findex(_funcall)
 item(tt(_funcall) var(return) var(name) [ var(args) ... ])(
 If a function var(name) exists, it is called with the arguments
@@ -3395,18 +3386,12 @@
 passed unchanged to the tt(compadd) builtin.
 )
 findex(_path_files)
-findex(_files)
-item(tt(_path_files) and tt(_files))(
+item(tt(_path_files))(
 The function tt(_path_files) is used throughout the completion system
 to complete filenames.  It allows completion of partial paths.  For
 example, the string `tt(/u/i/s/sig)' may be completed to
 `tt(/usr/include/sys/signal.h)'.
 
-The function tt(_files) uses the tt(file-patterns) style and calls
-tt(_path_files) with all the arguments it was passed except for tt(-g) 
-and tt(-/).  These two options are used depending on the setting of the 
-tt(file-patterns) style.
-
 The options accepted by both tt(_path_files) and tt(_files) are:
 
 startitem()
@@ -3695,6 +3680,25 @@
 tt(curcontext) parameter. This allows to make tt(_tags) use a more
 specific context name without having to change and reset the
 tt(curcontext) parameter (which would otherwise have the same effect).
+)
+findex(_use_lo)
+item(tt(_use_lo))(
+This function is a simple wrapper around the tt(_arguments) function
+described above.  It can be used to automatically complete long
+options for commands that understand the `tt(-)tt(-help)' option
+(`tt(_use_lo)' is for `use long options').  It is not intended to be
+used from completion functions but as a top-level completion function
+in its own right.  For example, to enable option completion for the
+commands tt(foo) and tt(bar), one would call:
+
+example(compdef _use_lo foo bar)
+
+in one of the initialization files after the call to tt(compinit).
+
+The default installation uses this function only to generate
+completions for some GNU-commands because to complete the options, the 
+command has to be called and hence it shouldn't be used if one can't
+be sure that the command understands the `tt(-)tt(-help)' option.
 )
 findex(_wanted)
 item(tt(_wanted) [ tt(-C) var(name) ]  [ tt(-12VJ) ] var(tag) var(name) var(descr) var(command) var(args) ...)(

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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