Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 7, 2018

Conversation

segevfiner
Copy link
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
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
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