Added a segment that shows the current GO version number.

This commit is contained in:
Dominik Ritter 2015-09-21 18:27:03 +02:00
commit 1a5edebae7
2 changed files with 11 additions and 0 deletions

View file

@ -608,6 +608,16 @@ prompt_dir() {
"$1_prompt_segment" "$0" "blue" "$DEFAULT_COLOR" "$(print_icon 'HOME_ICON')$current_path"
}
# GO-prompt
prompt_go_version() {
local go_version
go_version=$(go version 2>&1 | grep -oe "^go[0-9.]*")
if [[ -n "$go_version" ]]; then
"$1_prompt_segment" "$0" "green" "255" "$go_version"
fi
}
# Command number (in local history)
prompt_history() {
"$1_prompt_segment" "$0" "244" "$DEFAULT_COLOR" '%h'