Add rust prompt (#261)

Closes #258
This commit is contained in:
Dan Kaplun
2018-02-05 18:39:21 -05:00
committed by Caio Gondim
parent e9e1e9f363
commit 06f1d86ae2

View File

@@ -30,6 +30,7 @@ if [ ! -n "${BULLETTRAIN_PROMPT_ORDER+1}" ]; then
nvm
aws
go
rust
elixir
git
hg
@@ -139,6 +140,17 @@ if [ ! -n "${BULLETTRAIN_GO_PREFIX+1}" ]; then
BULLETTRAIN_GO_PREFIX="go"
fi
# Rust
if [ ! -n "${BULLETTRAIN_RUST_BG+1}" ]; then
BULLETTRAIN_RUST_BG=black
fi
if [ ! -n "${BULLETTRAIN_RUST_FG+1}" ]; then
BULLETTRAIN_RUST_FG=white
fi
if [ ! -n "${BULLETTRAIN_RUST_PREFIX+1}" ]; then
BULLETTRAIN_RUST_PREFIX="🦀"
fi
# Kubernetes Context
if [ ! -n "${BULLETTRAIN_KCTX_BG+1}" ]; then
BULLETTRAIN_KCTX_BG=yellow
@@ -529,6 +541,15 @@ prompt_go() {
fi
}
# Rust
prompt_rust() {
if [[ (-f Cargo.toml) ]]; then
if command -v rustc > /dev/null 2>&1; then
prompt_segment $BULLETTRAIN_RUST_BG $BULLETTRAIN_RUST_FG $BULLETTRAIN_RUST_PREFIX" $(rustc -V version | cut -d' ' -f2)"
fi
fi
}
# Kubernetes Context
prompt_kctx() {
if [[ ! -n $BULLETTRAIN_KCTX_KCONFIG ]]; then