summaryrefslogtreecommitdiffstats
path: root/Completion/Base/_command_names
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-26 15:36:10 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-26 15:36:10 +0000
commite0b26186f1d3c1a3a580eb7e8a8199c25536f4e6 (patch)
treee4247c2507fa1a135740a3cd02e7405cbdbfa69a /Completion/Base/_command_names
parentmanual/8413 (diff)
downloadzsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar
zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.gz
zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.bz2
zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.lz
zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.xz
zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.zst
zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.zip
manual/8424
Diffstat (limited to 'Completion/Base/_command_names')
-rw-r--r--Completion/Base/_command_names24
1 files changed, 17 insertions, 7 deletions
diff --git a/Completion/Base/_command_names b/Completion/Base/_command_names
index 2218aac21..79bd46e84 100644
--- a/Completion/Base/_command_names
+++ b/Completion/Base/_command_names
@@ -4,24 +4,34 @@
# complete only external commands and executable files. This and a
# `-' as the first argument is then removed from the arguments.
-local nm=$compstate[nmatches] ret=1 expl type=-c
+local nm=$compstate[nmatches] ret=1 expl ext
if [[ "$1" = -e ]]; then
- type=-m
+ ext=yes
shift
elif [[ "$1" = - ]]; then
shift
fi
# Complete jobs in implicit fg and bg
-if [[ $type = -c && "$PREFIX[1]" = "%" ]]; then
- _description expl job
- compgen "$expl[@]" "$@" -j -P '%'
+if [[ -z "$ext" && "$PREFIX[1]" = "%" ]]; then
+ _job -P '%'
[[ nm -ne compstate[nmatches] ]] && return
fi
-_description expl command
-compgen "$expl[@]" "$@" $type && ret=0
+_description expl 'external command'
+compadd "$expl[@]" "$@" - "${(k@)commands}" && ret=0
+
+if [[ -z "$ext" ]]; then
+ _description expl 'builtin command'
+ compadd "$expl[@]" "$@" - "${(k@)builtins[(R)^?disabled*]}" && ret=0
+ _description expl 'shell function'
+ compadd "$expl[@]" "$@" - "${(k@)functions[(R)^?disabled*]}" && ret=0
+ _description expl 'alias'
+ compadd "$expl[@]" "$@" - "${(k@)raliases[(R)^?disabled*]}" && ret=0
+ _description expl 'reserved word'
+ compadd "$expl[@]" "$@" - "${(k@)reswords[(R)^?disabled*]}" && ret=0
+fi
if [[ nm -eq compstate[nmatches] ]]; then
_description expl 'executable file or directory'