mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-17 22:31:12 +01:00
44202 (tweaked): _normal: Add -P to reset precommands
This commit is contained in:
parent
7d84cde313
commit
6f35d6c0d0
3 changed files with 12 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
|||
2019-04-04 Matthew Martin <phy1729@gmail.com>
|
||||
|
||||
* 44202 (tweaked): Completion/Base/Core/_normal,
|
||||
Doc/Zsh/compsys.yo: Add -P to reset precommands.
|
||||
|
||||
* 44201: Completion/Base/Core/_main_complete,
|
||||
Completion/Base/Utility/_pick_variant,
|
||||
Completion/Linux/Command/_setsid,
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
local _comp_command1 _comp_command2 _comp_command precommand
|
||||
local -A opts
|
||||
|
||||
zparseopts -A opts -D - p+:-=precommand s
|
||||
zparseopts -A opts -D - P p+:-=precommand s
|
||||
(( $+opts[-s] )) || _compskip=
|
||||
(( $+opts[-P] )) && precommands=()
|
||||
(( $#precommand )) && precommands+=(${precommand#-p})
|
||||
|
||||
# Check for a history reference to complete modifiers.
|
||||
|
|
|
@ -4658,7 +4658,7 @@ fi
|
|||
return ret)
|
||||
)
|
||||
findex(_normal)
|
||||
item(tt(_normal) [ tt(-p) var(precommand) ])(
|
||||
item(tt(_normal) [ tt(-P) | tt(-p) var(precommand) ])(
|
||||
This is the standard function called to handle completion outside
|
||||
any special tt(-)var(context)tt(-). It is called both to complete the command
|
||||
word and also the arguments for a command. In the second case,
|
||||
|
@ -4674,9 +4674,14 @@ then calls `tt(_normal -p $service)'. The effect is that
|
|||
`tt(nohup) var(cmd ...)' is treated in the same way as `var(cmd ...)'.
|
||||
|
||||
startitem()
|
||||
item(tt(-P))(
|
||||
Reset the list of precommands. This option should be used if completing
|
||||
a command line which allows internal commands (e.g. builtins and
|
||||
functions) regardless of prior precommands (e.g. `tt(zsh -c)').
|
||||
)
|
||||
item(tt(-p) var(precommand))(
|
||||
Append var(precommand) to the list of precommands. This option should be
|
||||
used in nearly all cases.
|
||||
used in nearly all cases in which tt(-P) is not applicable.
|
||||
)
|
||||
enditem()
|
||||
|
||||
|
|
Loading…
Reference in a new issue