Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add subcommands to "rustup show" for active-toolchain and it's version#1449

Merged
Diggsey merged 2 commits into
rust-lang:masterfrom
segevfiner:show-active-toolchain-command
Jul 7, 2018
Merged

Add subcommands to "rustup show" for active-toolchain and it's version#1449
Diggsey merged 2 commits into
rust-lang:masterfrom
segevfiner:show-active-toolchain-command

Conversation

@segevfiner
Copy link
Copy Markdown
Contributor

This should be useful to shell scripts (via command substitution) and other programs that need this information.

Do note that the new commands currently succeed and print nothing when there is no active tool chain. I'm not sure if that's the proper behavior.

Related: #450

This should be useful to shell scripts (via command substitution) and
other programs that need this information.

Related: rust-lang#450
@Diggsey
Copy link
Copy Markdown
Contributor

Diggsey commented Jul 1, 2018

Thanks for the PR!

I'm not sure the "version" variant is strictly necessary? You can just run rustc --version. Getting the active toolchain name is potentially useful, although I think there is potential for misusing it to figure out the toolchain directory: the directory should be obtained using rustc --print sysroot.

Could you remove the version variant, and add a note to the help text for the other variant to consider using rustc --print sysroot instead?

@Diggsey
Copy link
Copy Markdown
Contributor

Diggsey commented Jul 1, 2018

Also, could you add a test for the new behaviour. Nevermind, I see you've already got one :)

@Diggsey Diggsey merged commit cc1de61 into rust-lang:master Jul 7, 2018
@segevfiner segevfiner deleted the show-active-toolchain-command branch November 4, 2018 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants