From 5d314bec8e6465feca3a757d4e8a9a626d322561 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Wed, 30 Sep 2015 20:12:47 +0200 Subject: Add segment for rust version. --- powerlevel9k.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'powerlevel9k.zsh-theme') diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index b4f993ec..982024f5 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -479,6 +479,15 @@ prompt_rbenv() { fi } +# print Rust version number +prompt_rust_version() { + local rust_version + rust_version=$(rustc --version 2>&1 | grep -oe "^rustc\s*[^ ]*" | grep -o '[0-9.a-z\\\-]*$') + + if [[ -n "$rust_version" ]]; then + "$1_prompt_segment" "$0" "208" "$DEFAULT_COLOR" "$rust_version" + fi +} # RSpec test ratio prompt_rspec_stats() { if [[ (-d app && -d spec) ]]; then -- cgit v1.2.3