Skip to content

Commit 898ccde

Browse files
committed
Auto merge of #8740 - nop:target-completion, r=ehuss
Add Zsh completion for target triples Target triples are used for specifying targets for e.g. `cargo build --target thumbv7em-none-eabihf` where `thumbv7em-none-eabihf` is the target triplet. For more information on target triples, see <https://doc.rust-lang.org/cargo/appendix/glossary.html#target>.
2 parents 76c0161 + 7a9810f commit 898ccde

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/etc/_cargo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ _cargo() {
5656
)
5757

5858
msgfmt='--message-format=[specify error format]:error format [human]:(human json short)'
59-
triple='--target=[specify target triple]:target triple'
59+
triple='--target=[specify target triple]:target triple:_cargo_target_triple'
6060
target='--target-dir=[specify directory for all generated artifacts]:directory:_directories'
6161
manifest='--manifest-path=[specify path to manifest]:path:_directories'
6262
registry='--registry=[specify registry to use]:registry'
@@ -359,6 +359,11 @@ _cargo_cmds() {
359359
_describe -t commands 'command' commands
360360
}
361361

362+
_cargo_target_triple() {
363+
local -a targets
364+
targets=( ${(f)"$(rustc --print target-list)"} )
365+
_describe 'target triple' targets
366+
}
362367

363368
#FIXME: Disabled until fixed
364369
#gets package names from the manifest file

0 commit comments

Comments
 (0)