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. --- ChangeLog | 4 ++++ Completion/Zsh/Type/_command_names | 12 ++++++++---- 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 + * 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[@]" -- cgit 1.4.1