Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix local declarations for zsh completions #753

Merged
merged 1 commit into from
Oct 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions src/rustup-cli/zsh/_rustup
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ case $state in
args)
case $words[1] in
component)
local -a subcommands=(
local -a subcommands
subcommands=(
'list:list installed and available components'
'add:add a component to a toolchain'
'remove:remove a component from a toolchain'
Expand Down Expand Up @@ -52,7 +53,8 @@ case $state in
;;

override)
local -a subcommands=(
local -a subcommands
subcommands=(
'list:list directory toolchain overrides'
'set:set the override toolchain for a directory'
'unset:remove the override toolchain for a directory'
Expand All @@ -72,7 +74,8 @@ case $state in


self)
local -a subcommands=(
local -a subcommands
subcommands=(
'update:download and install updates to rustup'
'uninstall:uninstall rustup'
'upgrade-data:upgrade the internal data format'
Expand All @@ -84,7 +87,8 @@ case $state in
;;

set)
local -a subcommands=(
local -a subcommands
subcommands=(
'default-host:The triple used to identify toolchains' \
'help:prints this message or the help of the given subcommand(s)'
)
Expand All @@ -98,7 +102,8 @@ case $state in
;;

target)
local -a subcommands=(
local -a subcommands
subcommands=(
'list:list installed and available targets'
'add:add a target to a toolchain'
'remove:remove a target from a toolchain'
Expand All @@ -110,7 +115,8 @@ case $state in
;;

toolchain)
local -a subcommands=(
local -a subcommands
subcommands=(
'list:list installed toolchains'
'install:install or update a toolchain'
'uninstall:uninstall a toolchain'
Expand Down Expand Up @@ -139,7 +145,8 @@ esac
}

_get_local_toolchains() {
local -a toolchains=()
local -a toolchains
toolchains=()
rustup toolchain list 2>/dev/null | while read line
do
toolchains+="${line%%-*}"
Expand All @@ -148,7 +155,9 @@ _get_local_toolchains() {
}

_rustup_cmds(){
local -a commands=(
local -a commands

commands=(
'show:show the active and installed toolchains'
'update:update Rust toolchains'
'default:set the default toolchain'
Expand Down