mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
Minor tweak to _generic plus doc fixes for info interpretation of hyphens.
This commit is contained in:
parent
d373eb8f1e
commit
337a2e3bfd
10 changed files with 58 additions and 49 deletions
|
@ -8,4 +8,4 @@ else
|
|||
curcontext="${WIDGET}:${curcontext#*:}"
|
||||
fi
|
||||
|
||||
_main_complete
|
||||
_main_complete "$@"
|
||||
|
|
|
@ -110,11 +110,12 @@ zsh.info: $(sdir)/zsh.texi
|
|||
$(MAKEINFO) $(sdir)/zsh.texi
|
||||
|
||||
.yo.1:
|
||||
case $@ in \
|
||||
@case $@ in \
|
||||
*/*) target=$@ ;; \
|
||||
*) target=$(sdir)/$@ ;; \
|
||||
esac; \
|
||||
case '$(YODL)' in :*) ;; *) \
|
||||
echo $(YODL) -o $$target -I$(sdir) -w zman.yo version.yo $< ; \
|
||||
$(YODL) -I$(sdir) -w zman.yo version.yo $< | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $$target \
|
||||
;; esac; \
|
||||
test -f $$target
|
||||
|
@ -141,11 +142,12 @@ zsh_toc.html: $(sdir)/zsh.texi
|
|||
$(TEXI2HTML) $(sdir)/zsh.texi
|
||||
|
||||
zshall.1: zsh.yo
|
||||
case $@ in \
|
||||
@case $@ in \
|
||||
*/*) target=$@ ;; \
|
||||
*) target=$(sdir)/$@ ;; \
|
||||
esac; \
|
||||
case '$(YODL)' in :*) ;; *) \
|
||||
echo $(YODL) -o $$target -I$(sdir) -DZSHALL -w zman.yo version.yo zsh.yo; \
|
||||
$(YODL) -I$(sdir) -DZSHALL -w zman.yo version.yo zsh.yo | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $$target \
|
||||
;; esac; \
|
||||
test -f $$target
|
||||
|
|
|
@ -507,7 +507,7 @@ item(tt(getopts) var(optstring) var(name) [ var(arg) ... ])(
|
|||
Checks the var(arg)s for legal options. If the var(arg)s are omitted,
|
||||
use the positional parameters. A valid option argument
|
||||
begins with a `tt(PLUS())' or a `tt(-)'. An argument not beginning with
|
||||
a `tt(PLUS())' or a `tt(-)', or the argument `tt(--)', ends the options.
|
||||
a `tt(PLUS())' or a `tt(-)', or the argument `tt(-)tt(-)', ends the options.
|
||||
Note that a single `tt(-)' is not considered a valid option argument.
|
||||
var(optstring) contains the letters that tt(getopts)
|
||||
recognizes. If a letter is followed by a `tt(:)', that option
|
||||
|
@ -1085,7 +1085,7 @@ the array. This means that
|
|||
|
||||
example(set -A array -x -- foo)
|
||||
|
||||
sets tt(array) to `tt(-x -- foo)' if tt(KSH_ARRAYS) is not set, but sets
|
||||
sets tt(array) to `tt(-x -)tt(- foo)' if tt(KSH_ARRAYS) is not set, but sets
|
||||
the array to tt(foo) and turns on the option `tt(-x)' if it is set.
|
||||
|
||||
If the tt(-A) flag is not present, but there are arguments beyond the
|
||||
|
|
|
@ -26,8 +26,8 @@ findex(compctl)
|
|||
startlist()
|
||||
list(tt(compctl) [ tt(-CDT) ] var(options) [ var(command) ... ])
|
||||
list(tt(compctl) [ tt(-CDT) ] var(options) \
|
||||
[ tt(-x) var(pattern) var(options) tt(-) ... tt(--) ] \
|
||||
[ tt(PLUS()) var(options) [ tt(-x) ... tt(--) ] ... [tt(PLUS())] ] \
|
||||
[ tt(-x) var(pattern) var(options) tt(-) ... tt(-)tt(-) ] \
|
||||
[ tt(PLUS()) var(options) [ tt(-x) ... tt(-)tt(-) ] ... [tt(PLUS())] ] \
|
||||
[ var(command) ... ])
|
||||
list(tt(compctl) tt(-M) var(match-specs) ...)
|
||||
list(tt(compctl) tt(-L) [ tt(-CDTM) ] [ var(command) ... ])
|
||||
|
@ -562,11 +562,11 @@ texinode(Extended Completion)(Example)(Alternative Completion)(Completion Using
|
|||
sect(Extended Completion)
|
||||
startlist()
|
||||
list(nofill(tt(compctl) [ tt(-CDT) ] var(options) \
|
||||
tt(-x) var(pattern) var(options) tt(-) ... tt(--)
|
||||
tt(-x) var(pattern) var(options) tt(-) ... tt(-)tt(-)
|
||||
[ var(command) ... ]))
|
||||
list(nofill(tt(compctl) [ tt(-CDT) ] var(options) \
|
||||
[ tt(-x) var(pattern) var(options) tt(-) ... tt(--) ]
|
||||
[ tt(PLUS()) var(options) [ tt(-x) ... tt(--) ] ... [tt(PLUS())] ] \
|
||||
[ tt(-x) var(pattern) var(options) tt(-) ... tt(-)tt(-) ]
|
||||
[ tt(PLUS()) var(options) [ tt(-x) ... tt(-)tt(-) ] ... [tt(PLUS())] ] \
|
||||
[ var(command) ... ]))
|
||||
endlist()
|
||||
|
||||
|
|
|
@ -481,12 +481,12 @@ functions in the tt(Widget) directory of the distribution to the name of
|
|||
that function, often in an abbreviated form.
|
||||
)
|
||||
itemiz(\
|
||||
The var(completer) currently active, the name of the function
|
||||
without the leading underscore. A `completer' is in
|
||||
overall control of how completion is to be performed; `tt(complete)'
|
||||
is the simplest, but other completers exist to perform
|
||||
related tasks such as correction, or to modify the behaviour of a
|
||||
later completer. See
|
||||
The var(completer) currently active, the name of the function without the
|
||||
leading underscore and with other underscores converted to hyphens. A
|
||||
`completer' is in overall control of how completion is to be performed;
|
||||
`tt(complete)' is the simplest, but other completers exist to perform
|
||||
related tasks such as correction, or to modify the behaviour of a later
|
||||
completer. See
|
||||
ifzman(the section `Control Functions' below)\
|
||||
ifnzman(noderef(Control Functions))
|
||||
for more information.
|
||||
|
@ -748,7 +748,7 @@ for file system types (e.g. for the tt(mount) command)
|
|||
)
|
||||
kindex(functions, completion tag)
|
||||
item(tt(functions))(
|
||||
names of functions --- normally shell functions, although certain
|
||||
names of functions DASH()- normally shell functions, although certain
|
||||
commands may understand other kinds of function
|
||||
)
|
||||
kindex(globbed-files, completion tag)
|
||||
|
@ -1303,9 +1303,9 @@ object file:
|
|||
example(zstyle ':completion:*:*:rm:*' file-patterns \
|
||||
'*.o:object-files' '%p:all-files')
|
||||
|
||||
To alter the default behaviour of file completion --- offer files
|
||||
To alter the default behaviour of file completion DASH()- offer files
|
||||
matching a pattern and directories on the first attempt, then all files
|
||||
--- to offer only matching files on the first attempt, then directories,
|
||||
DASH()- to offer only matching files on the first attempt, then directories,
|
||||
and finally all files:
|
||||
|
||||
example(zstyle ':completion:*' file-patterns \
|
||||
|
@ -2027,7 +2027,7 @@ example(zstyle ':completion:*:complete:dpkg:option--status-1:*' \
|
|||
packageset avail)
|
||||
|
||||
causes available packages, rather than only installed packages,
|
||||
to be completed for `dpkg --status'.
|
||||
to be completed for `tt(dpkg -)tt(-status)'.
|
||||
)
|
||||
kindex(path, completion style)
|
||||
item(tt(path))(
|
||||
|
@ -2692,7 +2692,7 @@ This completer function is intended to be used without the
|
|||
tt(_approximate) completer or, as in the example, just before
|
||||
it. Using it after the tt(_approximate) completer is useless since
|
||||
tt(_approximate) will at least generate the corrected strings
|
||||
generated by the tt(_correct) completer -- and probably more.
|
||||
generated by the tt(_correct) completer DASH()- and probably more.
|
||||
)
|
||||
findex(_expand)
|
||||
item(tt(_expand))(
|
||||
|
@ -2818,7 +2818,7 @@ to the tt(expand-or-complete-prefix) command.
|
|||
|
||||
The tt(completer) style is used to decide which other completers are to
|
||||
be called to generate matches. If this style is unset, the list of
|
||||
completers set for the current context is used -- except, of course, the
|
||||
completers set for the current context is used DASH()- except, of course, the
|
||||
tt(_prefix) completer itself. Furthermore, if this completer appears
|
||||
more than once in the list of completers only those completers not
|
||||
already tried by the last invocation of tt(_prefix) will be called.
|
||||
|
@ -2939,6 +2939,12 @@ menu selection:
|
|||
example(zle -C foo complete-word _generic
|
||||
bindkey '...' foo
|
||||
zstyle ':completion:foo:*' menu yes select=1)
|
||||
|
||||
Note in particular that the tt(completer) style may be set for the context
|
||||
in order to change the set of functions used to generate possible matches.
|
||||
If tt(_generic) is called with arguments, those are passed through to
|
||||
tt(_main_complete) as the list of completers in place of those defined by
|
||||
the tt(completer) style.
|
||||
)
|
||||
findex(_history_complete_word (\e/))
|
||||
item(tt(_history_complete_word) (\e/))(
|
||||
|
@ -3505,7 +3511,7 @@ example(local curcontext="$curcontext")
|
|||
This is useful where it is not possible for multiple states to be valid
|
||||
together.
|
||||
|
||||
The option `tt(--)' allows tt(_arguments) to work out the names of long
|
||||
The option `tt(-)tt(-)' allows tt(_arguments) to work out the names of long
|
||||
options that support the `tt(-)tt(-help)' option which is standard in many
|
||||
GNU commands. The command word is called with the argument
|
||||
`tt(-)tt(-help)' and the output examined for option names. Clearly, it can
|
||||
|
@ -3537,7 +3543,7 @@ of these patterns. A typical help text which uses this feature is:
|
|||
example( -C, --directory=DIR change to directory DIR)
|
||||
|
||||
so that the above specifications will cause directories to be completed
|
||||
after `tt(--directory)', though not after `tt(-C)'.
|
||||
after `tt(-)tt(-directory)', though not after `tt(-C)'.
|
||||
|
||||
Note also that tt(_arguments) tries to find out automatically if the
|
||||
argument for an option is optional. This can be specified explicitly by
|
||||
|
@ -4406,7 +4412,7 @@ some attempt is made to decide which version of a command is present. For
|
|||
example, completion for the tt(mount) command tries to determine the system
|
||||
it is running on, while completion for many other utilities try to decide
|
||||
whether the GNU version of the command is in use, and hence whether the
|
||||
tt(--help) option is supported.
|
||||
tt(-)tt(-help) option is supported.
|
||||
)
|
||||
item(tt(X), tt(AIX), tt(BSD), ...)(
|
||||
Completion and utility function for commands available only on some systems.
|
||||
|
|
|
@ -11,7 +11,7 @@ features is described in
|
|||
ifzman(zmanref(zshcompsys))\
|
||||
ifnzman(the next chapter, noderef(Completion System)),
|
||||
and users with no interest in adding to that system (or, potentially,
|
||||
writing their own --- see dictionary entry for `hubris') should skip this
|
||||
writing their own DASH()- see dictionary entry for `hubris') should skip this
|
||||
section. The older system based on the tt(compctl) builtin command is
|
||||
described in
|
||||
ifzman(zmanref(zshcompctl))\
|
||||
|
@ -445,7 +445,7 @@ xitem([ tt(-J) var(name) ] [ tt(-V) var(name) ] [ tt(-X) var(explanation) ] [ tt
|
|||
xitem([ tt(-r) var(remove-chars) ] [ tt(-R) var(remove-func) ])
|
||||
xitem([ tt(-D) var(array) ] [ tt(-O) var(array) ] [ tt(-A) var(array) ])
|
||||
xitem([ tt(-E) var(number) ])
|
||||
item([ tt(-M) var(match-spec) ] [ tt(--) ] [ var(words) ... ])(
|
||||
item([ tt(-M) var(match-spec) ] [ tt(-)tt(-) ] [ var(words) ... ])(
|
||||
|
||||
This builtin command can be used to add matches directly and control
|
||||
all the information the completion code stores with each possible
|
||||
|
@ -925,7 +925,7 @@ The pattern var(tpat) may also be one or two stars, `tt(*)' or
|
|||
any number of characters in the trial completion. In this case the
|
||||
pattern must be anchored (on either side); in the case of a single
|
||||
star, the var(anchor) then determines how much of the trial completion
|
||||
is to be included --- only the characters up to the next appearance of
|
||||
is to be included DASH()- only the characters up to the next appearance of
|
||||
the anchor will be matched. With two stars, substrings matched by the
|
||||
anchor can be matched, too.
|
||||
|
||||
|
@ -983,7 +983,7 @@ A nice example for the use of tt(*) patterns is partial word
|
|||
completion. Sometimes you would like to make strings like `tt(c.s.u)'
|
||||
complete to strings like `tt(comp.source.unix)', i.e. the word on the
|
||||
command line consists of multiple parts, separated by a dot in this
|
||||
example, where each part should be completed separately --- note,
|
||||
example, where each part should be completed separately DASH()- note,
|
||||
however, that the case where each part of the word, i.e. `tt(comp)',
|
||||
`tt(source)' and `tt(unix)' in this example, is to be completed from
|
||||
separate sets of matches
|
||||
|
|
|
@ -1422,9 +1422,9 @@ using the value of tt($match[1]) rather than tt($match[2]).
|
|||
|
||||
If the match fails none of the parameters is altered, so in some cases it
|
||||
may be necessary to initialise them beforehand. If some of the
|
||||
backreferences fail to match --- which happens if they are in an alternate
|
||||
backreferences fail to match DASH()- which happens if they are in an alternate
|
||||
branch which fails to match, or if they are followed by tt(#) and matched
|
||||
zero times --- then the matched string is set to the empty string, and the
|
||||
zero times DASH()- then the matched string is set to the empty string, and the
|
||||
start and end indices are set to -1.
|
||||
|
||||
Pattern matching with backreferences is slightly slower than without.
|
||||
|
@ -1872,7 +1872,7 @@ are sorted depending on the size (length) of the files; if tt(l)
|
|||
they are sorted by the number of links; if tt(a), tt(m), or tt(c)
|
||||
they are sorted by the time of the last access, modification, or
|
||||
inode change respectively; if tt(d), files in subdirectories appear before
|
||||
those in the current directory at each level of the search --- this is best
|
||||
those in the current directory at each level of the search DASH()- this is best
|
||||
combined with other criteria, for example `tt(odon)' to sort on names for
|
||||
files within the same directory. Note that tt(a), tt(m), and tt(c) compare
|
||||
the age against the current time, hence the first name in the list is the
|
||||
|
|
|
@ -51,32 +51,33 @@ tt(-o) can be stacked up with preceding single-letter options, so for example
|
|||
|
||||
cindex(long option)
|
||||
Options may also be specified by name in GNU long option style,
|
||||
`tt(--)var(option-name)'. When this is done, `tt(-)' characters in the
|
||||
`tt(-)tt(-)var(option-name)'. When this is done, `tt(-)' characters in the
|
||||
option name are permitted: they are translated into `tt(_)', and thus ignored.
|
||||
So, for example, `tt(zsh --sh-word-split)' invokes zsh with the
|
||||
So, for example, `tt(zsh -)tt(-sh-word-split)' invokes zsh with the
|
||||
tt(SH_WORD_SPLIT) option turned on. Like other option syntaxes, options can
|
||||
be turned off by replacing the initial `tt(-)' with a `tt(PLUS())'; thus
|
||||
`tt(+-sh-word-split)' is equivalent to `tt(--no-sh-word-split)'.
|
||||
`tt(+-sh-word-split)' is equivalent to `tt(-)tt(-no-sh-word-split)'.
|
||||
Unlike other option syntaxes, GNU-style long options cannot be stacked with
|
||||
any other options, so for example `tt(-x-shwordsplit)' is an error,
|
||||
rather than being treated like `tt(-x --shwordsplit)'.
|
||||
rather than being treated like `tt(-x -)tt(-shwordsplit)'.
|
||||
|
||||
cindex(--version)
|
||||
cindex(--help)
|
||||
The special GNU-style option `tt(--version)' is handled; it sends to standard
|
||||
output the shell's version information, then exits successfully.
|
||||
`tt(--help)' is also handled; it sends to standard output a list of options
|
||||
that can be used when invoking the shell, then exits successfully.
|
||||
The special GNU-style option `tt(-)tt(-version)' is handled; it sends to
|
||||
standard output the shell's version information, then exits successfully.
|
||||
`tt(-)tt(-help)' is also handled; it sends to standard output a list of
|
||||
options that can be used when invoking the shell, then exits successfully.
|
||||
|
||||
Option processing may be finished, allowing following arguments that start with
|
||||
`tt(-)' or `tt(PLUS())' to be treated as normal arguments, in two ways.
|
||||
Firstly, a lone `tt(-)' (or `tt(PLUS())') as an argument by itself ends option
|
||||
processing. Secondly, a special option `tt(--)' (or `tt(PLUS()-)'), which may
|
||||
be specified on its own (which is the standard POSIX usage) or may be stacked
|
||||
with preceding options (so `tt(-x-)' is equivalent to `tt(-x --)'). Options
|
||||
are not permitted to be stacked after `tt(--)' (so `tt(-x-f)' is an error),
|
||||
but note the GNU-style option form discussed above, where `tt(--shwordsplit)'
|
||||
is permitted and does not end option processing.
|
||||
Firstly, a lone `tt(-)' (or `tt(PLUS())') as an argument by itself ends
|
||||
option processing. Secondly, a special option `tt(-)tt(-)' (or
|
||||
`tt(PLUS()-)'), which may be specified on its own (which is the standard
|
||||
POSIX usage) or may be stacked with preceding options (so `tt(-x-)' is
|
||||
equivalent to `tt(-x -)tt(-)'). Options are not permitted to be stacked
|
||||
after `tt(-)tt(-)' (so `tt(-x-f)' is an error), but note the GNU-style
|
||||
option form discussed above, where `tt(-)tt(-shwordsplit)' is permitted
|
||||
and does not end option processing.
|
||||
|
||||
Except when the bf(sh)/bf(ksh) emulation single-letter options are in effect,
|
||||
the option `tt(-b)' (or `tt(PLUS()b)') ends option processing.
|
||||
|
|
|
@ -192,7 +192,7 @@ xitem(var(name))
|
|||
item(var(name)tt(+))(
|
||||
The var(name) is the name of the option without the leading `tt(-)'. To
|
||||
specify a GNU-style long option, one of the usual two leading `tt(-)' must
|
||||
be included in var(name); for example, a `tt(--file)' option is
|
||||
be included in var(name); for example, a `tt(-)tt(-file)' option is
|
||||
represented by a var(name) of `tt(-file)'.
|
||||
|
||||
If a `tt(+)' appears after var(name), the option is appended to var(array)
|
||||
|
|
|
@ -394,7 +394,7 @@ The current implementation is somewhat deficient in terms of use of the
|
|||
command history. For this reason, many users will prefer to use some form
|
||||
of alternative approach for sending data easily to the current session.
|
||||
One simple approach is to alias some special character (such as `tt(%)') to
|
||||
`tt(tcp_command --)'.
|
||||
`tt(tcp_command -)tt(-)'.
|
||||
)
|
||||
findex(tcp_wait)
|
||||
item(tt(tcp_wait))(
|
||||
|
|
Loading…
Reference in a new issue