summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-09-30 21:12:47 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-11-16 01:46:17 +0300
commit5d314bec8e6465feca3a757d4e8a9a626d322561 (patch)
treebd2cda10bfc7f11c56c4b4d241b92f7a4bfca0cf /powerlevel9k.zsh-theme
parent0673352e7e02f8c5d539197ed58ac2327a264ee6 (diff)
Add segment for rust version.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme9
1 files changed, 9 insertions, 0 deletions
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