Skip to content

Shell prompt helper command #720

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

Closed
ijanos opened this issue Sep 13, 2016 · 3 comments
Closed

Shell prompt helper command #720

ijanos opened this issue Sep 13, 2016 · 3 comments

Comments

@ijanos
Copy link

ijanos commented Sep 13, 2016

I was using multirust ctl override-toolchain command to show the currently selected toolchain in my shell's prompt if the current directory contains a Cargo.toml file, similarly to showing the current git branch if the directory is a git repository. I've found issue #491 mentioning that ctl like commands are not likely to appear in rustup.

Would you consider this as a use case for a new rustup command or should I fall back to some other solution, like piping rustup's output through sed?

@kbknapp
Copy link
Contributor

kbknapp commented Sep 13, 2016

Although not a 1:1 solution, rustup show | tail -n 3 | head -n 1 shows something like:

$ rustup show | tail -n 3 | head -n 1
stable-x86_64-unknown-linux-gnu (default)

Which I'm sure could be cut down more if desired.

@ijanos
Copy link
Author

ijanos commented Sep 13, 2016

Well, programming rust is fun, so I threw together a small helper program for this. I think a subcommand like rustup show override could still be useful for prompts and other scripting purposes, so I will leave the issue open but feel free to close it if you think this is out of scope for the rustup project.

@Diggsey
Copy link
Contributor

Diggsey commented May 4, 2017

Dupe of #491

@Diggsey Diggsey closed this as completed May 4, 2017
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

No branches or pull requests

3 participants