mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-17 22:31:12 +01:00
44201: _command_name: Check for external forcing precommand
This commit is contained in:
parent
5facfd3280
commit
7d84cde313
6 changed files with 15 additions and 8 deletions
|
@ -1,5 +1,12 @@
|
|||
2019-04-04 Matthew Martin <phy1729@gmail.com>
|
||||
|
||||
* 44201: Completion/Base/Core/_main_complete,
|
||||
Completion/Base/Utility/_pick_variant,
|
||||
Completion/Linux/Command/_setsid,
|
||||
Completion/Zsh/Command/_command,
|
||||
Completion/Zsh/Type/_command_names: Check for external forcing
|
||||
precommand.
|
||||
|
||||
* 44200 (tweaked): Completion/Base/Core/_normal,
|
||||
Completion/Linux/Command/_setsid,
|
||||
Completion/Zsh/Command/_builtin,
|
||||
|
|
|
@ -45,6 +45,12 @@ unset _comp_priv_prefix
|
|||
# _precommand sets this to indicate we are following a precommand modifier
|
||||
local -a precommands
|
||||
|
||||
# Precommands which allow their wrapped command to be a builtin.
|
||||
# All of these are necessarily builtins or reserved words themselves,
|
||||
# but not all builtin precommands are listed here:
|
||||
# for one, the 'command' builtin is excluded.
|
||||
local -ar builtin_precommands=(- builtin eval exec nocorrect noglob time)
|
||||
|
||||
typeset -U _lastdescr _comp_ignore _comp_colors
|
||||
|
||||
{
|
||||
|
|
|
@ -4,12 +4,6 @@ local output cmd pat pre
|
|||
local -a var
|
||||
local -A opts
|
||||
|
||||
# Precommands which allow their wrapped command to be a builtin.
|
||||
# All of these are necessarily builtins or reserved words themselves,
|
||||
# but not all builtin precommands are listed here:
|
||||
# for one, the 'command' builtin is excluded.
|
||||
local -ar builtin_precommands=(- builtin eval exec nocorrect noglob time)
|
||||
|
||||
(( $+_cmd_variant )) || typeset -gA _cmd_variant
|
||||
|
||||
zparseopts -D -A opts b: c: r:
|
||||
|
|
|
@ -6,5 +6,4 @@ _arguments -s -S -A '-*' : \
|
|||
'(-c --ctty)'{-c,--ctty}'[set controlling terminal to current one]' \
|
||||
'(-f --fork)'{-f,--fork}'[always fork]' \
|
||||
'(-w --wait)'{-w,--wait}'[wait for program to exit, and use same return code]' \
|
||||
'1: :_path_commands' \
|
||||
'*:: : _normal -p $service'
|
||||
|
|
|
@ -4,5 +4,4 @@ _arguments \
|
|||
'-v[indicate result of command search]:*:command:_path_commands' \
|
||||
'-V[show result of command search in verbose form]:*:command:_path_commands' \
|
||||
'(-)-p[use default PATH to find command]' \
|
||||
':command:_path_commands' \
|
||||
'*:: : _normal -p $service'
|
||||
|
|
|
@ -21,6 +21,8 @@ defs=(
|
|||
|
||||
if [[ "$1" = -e ]]; then
|
||||
shift
|
||||
elif (( ${#precommands:|builtin_precommands} )); then
|
||||
# precommand excludes internal options below
|
||||
else
|
||||
[[ "$1" = - ]] && shift
|
||||
|
||||
|
|
Loading…
Reference in a new issue