summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Zsh/Type/_command_names12
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 690580050..d6c748bd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2021-12-13 Oliver Kiddle <opk@zsh.org>
+ * 49643: Completion/Zsh/Type/_command_names: facilitate use
+ of the fake style by always calling _description with the
+ executables tag
+
* 49634, reported by Claes Nästén: configure.ac: revert 28989,
defining _POSIX_C_SOURCE caused issues on Solaris 10 but
doesn't seem to be needed for musl anymore
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[@]"