From 78c51b34c026d295c146b01db3d534bc3cd9352b Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 13 Dec 2021 20:52:23 +0100 Subject: 49643: facilitate use of the fake style by always calling _description with the executables tag for command names Also allow the command-path style to include relative directories. --- Completion/Zsh/Type/_command_names | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Completion/Zsh/Type') diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names index b1c35f013..12cbd69c1 100644 --- a/Completion/Zsh/Type/_command_names +++ b/Completion/Zsh/Type/_command_names @@ -4,7 +4,7 @@ # complete only external commands and executable files. This and a # `-' as the first argument is then removed from the arguments. -local args defs ffilt +local args defs expl ffilt zstyle -t ":completion:${curcontext}:commands" rehash && rehash @@ -16,8 +16,12 @@ defs=( 'commands:external command:_path_commands' ) -[[ -n "$path[(r).]" || $PREFIX = */* ]] && - defs+=( 'executables:executable file:_files -g \*\(-\*\)' ) +if [[ -n "$path[(r).]" || $PREFIX = */* ]]; then + defs+=( 'executables:executable file:_files -g \*\(-\*\)' ) +else + # this is ignored but exists to facilitate the use of the fake style + _description executables expl 'executable file' +fi if [[ "$1" = -e ]]; then shift @@ -58,7 +62,7 @@ fi if (( $#cmdpath )); then local -a +h path local -A +h commands - path=( $cmdpath ) + path=( $cmdpath:A ) fi _alternative -O args "$defs[@]" -- cgit 1.4.1