rustup-version-name

Crates.iorustup-version-name
lib.rsrustup-version-name
version0.2.1
sourcesrc
created_at2016-06-24 15:04:47.033399
updated_at2016-12-13 16:51:41.191245
descriptionrustup toolchain override in your prompt
homepagehttps://github.com/badboy/rustup-version-name
repositoryhttps://github.com/badboy/rustup-version-name
max_upload_size
id5479
size6,892
Engine Devs (github:amethyst:engine-devs)

documentation

README

rustup-version-name

Show the used Rust toolchain version name for the current working directory.

If you use rustup you may have toolchain overrides for certain directories. Sometimes it is good to see which one that is. Put it in your prompt and it is there when you need to know.

Install

cargo install --git https://github.com/badboy/rustup-version-name

Use

rustup-version-name

Use in shell prompt

Add the following function to your .bashrc or .zshrc:

__rust_prompt() {
  local rustp=$(rustup-version-name)
  if [ -n "$rustp"  ] && [ "$rustp" != "default"  ]
  then
    echo " $rustp"
  fi
}

Add the function to your PS1:

PS1="[%~\$(__rust_prompt)%# "

Restart your shell and your done.

Todo

  • Search for override in upper directory.

License

MIT

Commit count: 18

cargo fmt