mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
53174: add Completion/Base/Utility/_as_if
This commit is contained in:
parent
9b8af0900f
commit
393cb298aa
3 changed files with 22 additions and 0 deletions
|
@ -3,6 +3,10 @@
|
|||
* 53144: Completion/Unix/Command/_sysctl:
|
||||
support completion with the dot delimiter on linux
|
||||
|
||||
* Matthew Martin: 53174 + comments:
|
||||
Completion/Base/Utility/_as_if: complete `as if'
|
||||
a different command were being completed
|
||||
|
||||
2024-11-05 Bart Schaefer <schaefer@toltec-ubuntu>
|
||||
|
||||
* 53209 + comments + test: Src/params.c, Test/D04parameter.ztst:
|
||||
|
|
10
Completion/Base/Utility/_as_if
Normal file
10
Completion/Base/Utility/_as_if
Normal file
|
@ -0,0 +1,10 @@
|
|||
#autoload
|
||||
local words=("$words[@]") CURRENT=$CURRENT
|
||||
local _comp_command1 _comp_command2 _comp_command
|
||||
|
||||
words[1]=("$@")
|
||||
(( CURRENT += $# - 1 ))
|
||||
|
||||
_set_command
|
||||
|
||||
_dispatch "$_comp_command" "$_comp_command1" "$_comp_command2" -default-
|
|
@ -4290,6 +4290,14 @@ arguments. The first describes the first argument as a
|
|||
be completed. The last description gives all other arguments the
|
||||
description `var(page number)' but does not offer completions.
|
||||
)
|
||||
findex(_as_if)
|
||||
item(tt(_as_if) var(command) [var(arg) ... ])(
|
||||
This function is useful when one command should be completed as if it were
|
||||
another command with particular arguments. For example to complete tt(foo) as
|
||||
if it were tt(bar --baz), use
|
||||
|
||||
example(compdef '_as_if bar --baz' foo)
|
||||
)
|
||||
findex(_cache_invalid)
|
||||
item(tt(_cache_invalid) var(cache_identifier))(
|
||||
This function returns status zero if the completions cache corresponding to
|
||||
|
|
Loading…
Reference in a new issue