diff options
author | Oliver Kiddle <opk@zsh.org> | 2021-12-13 20:52:23 +0100 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2021-12-13 20:52:23 +0100 |
commit | 78c51b34c026d295c146b01db3d534bc3cd9352b (patch) | |
tree | 76c488a4c5a2fd4867cda64f1bfc80d3dc96d1bc | |
parent | 6de4bcfcd5b47bec5a8acbdd5a4514ea06c8ea90 (diff) | |
download | zsh-78c51b34c026d295c146b01db3d534bc3cd9352b.tar.gz zsh-78c51b34c026d295c146b01db3d534bc3cd9352b.tar.xz zsh-78c51b34c026d295c146b01db3d534bc3cd9352b.zip |
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.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | 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 <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[@]" |