Skip to content

Commit

Permalink
Auto merge of #8740 - nop:target-completion, r=ehuss
Browse files Browse the repository at this point in the history
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>.
  • Loading branch information
bors committed Sep 28, 2020
2 parents 76c0161 + 7a9810f commit 898ccde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/etc/_cargo
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ _cargo() {
)

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

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

#FIXME: Disabled until fixed
#gets package names from the manifest file
Expand Down

0 comments on commit 898ccde

Please sign in to comment.