Skip to content

Commit b5c97d4

Browse files
author
Angelo Ross
committed
Prefer rustup on --target completion
1 parent 9098bb5 commit b5c97d4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/etc/_cargo

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,15 @@ _cargo_cmds() {
407407
}
408408

409409
_cargo_target_triple() {
410-
local -a targets
411-
targets=( ${(f)"$(rustc --print target-list)"} )
412-
_describe 'target triple' targets
410+
local -a result
411+
412+
if (( $+commands[rustup] )); then
413+
result=( ${(f)"$(rustup target list --installed)"} )
414+
else
415+
result=( ${(f)"$(rustc --print target-list)"} )
416+
fi
417+
418+
_describe 'target triple' result
413419
}
414420

415421
#FIXME: Disabled until fixed

0 commit comments

Comments
 (0)