Skip to content

Commit

Permalink
Prefer rustup on --target completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelin01 committed Aug 31, 2023
1 parent 9098bb5 commit b5c97d4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/etc/_cargo
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,15 @@ _cargo_cmds() {
}

_cargo_target_triple() {
local -a targets
targets=( ${(f)"$(rustc --print target-list)"} )
_describe 'target triple' targets
local -a result

if (( $+commands[rustup] )); then
result=( ${(f)"$(rustup target list --installed)"} )
else
result=( ${(f)"$(rustc --print target-list)"} )
fi

_describe 'target triple' result
}

#FIXME: Disabled until fixed
Expand Down

0 comments on commit b5c97d4

Please sign in to comment.