diff options
author | 2022-12-08 17:32:25 -0800 | |
---|---|---|
committer | 2022-12-08 17:32:25 -0800 | |
commit | e6c2f48895454426cda4eb7dcfd1c2db996897e7 (patch) | |
tree | 1c2e6ebe27055ff93a8bc74e69bb89749e9b31ba | |
parent | cf961336d061bb819227850024819a6c4655f038 (diff) | |
download | bun-e6c2f48895454426cda4eb7dcfd1c2db996897e7.tar.gz bun-e6c2f48895454426cda4eb7dcfd1c2db996897e7.tar.zst bun-e6c2f48895454426cda4eb7dcfd1c2db996897e7.zip |
Add filename completions on naked bun command (#1593)
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
-rw-r--r-- | completions/bun.zsh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/completions/bun.zsh b/completions/bun.zsh index 4ea34a349..a61ac33e4 100644 --- a/completions/bun.zsh +++ b/completions/bun.zsh @@ -1,3 +1,4 @@ +#compdef bun _bun() { zstyle ':completion:*:*:bun:*' group-name '' zstyle ':completion:*:*:bun-grouped:*' group-name '' @@ -20,10 +21,11 @@ _bun() { local -a scripts_list IFS=$'\n' scripts_list=($(SHELL=zsh bun getcompletes i)) scripts="scripts:scripts:(($scripts_list))" + IFS=$'\n' files_list=($(SHELL=zsh bun getcompletes j)) main_commands=('add\:"Add a dependency to package.json" bun\:"Generate a bundle" create\:"Create a new project" dev\:"Start a dev server" help\:"Show command help" install\:"Install packages from package.json" remove\:"Remove a dependency from package.json" run\:"Run a script or package bin" upgrade\:"Upgrade to the latest version of bun"') main_commands=($main_commands) - _alternative "$scripts" "args:bun:(($main_commands))" + _alternative "$scripts" "args:command:(($main_commands))" "files:files:(($files_list))" ;; args) case $line[1] in |