From 2c2c88288fd282569c88397aa0b6ffab053fa1b0 Mon Sep 17 00:00:00 2001 From: Clint Howarth Date: Tue, 17 May 2011 09:24:46 +0800 Subject: add short hostname option --- git-prompt.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'git-prompt.sh') diff --git a/git-prompt.sh b/git-prompt.sh index a7022d2..7ac5c3d 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -62,7 +62,8 @@ max_file_list_length=${max_file_list_length:-100} - upcase_hostname=${upcase_hostname:-on} + short_hostname=${short_hostname:-off} + upcase_hostname=${upcase_hostname:-on} count_only=${count_only:-off} rawhex_len=${rawhex_len:-5} @@ -297,7 +298,9 @@ set_shell_label() { #then host=${HOSTNAME} - #host=`hostname -s` + if [[ $short_hostname = "on" ]]; then + host=`hostname -s` + fi host=${host#$default_host} uphost=`echo ${host} | tr a-z A-Z` if [[ $upcase_hostname = "on" ]]; then -- cgit v1.2.3 From c8e5b8273a0d63b4c2450743e460cf51410445fb Mon Sep 17 00:00:00 2001 From: Clint Howarth Date: Tue, 17 May 2011 09:54:38 +0800 Subject: short hostname cleanup --- git-prompt.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'git-prompt.sh') diff --git a/git-prompt.sh b/git-prompt.sh index 7ac5c3d..837fc81 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -63,7 +63,7 @@ max_file_list_length=${max_file_list_length:-100} short_hostname=${short_hostname:-off} - upcase_hostname=${upcase_hostname:-on} + upcase_hostname=${upcase_hostname:-on} count_only=${count_only:-off} rawhex_len=${rawhex_len:-5} @@ -298,9 +298,9 @@ set_shell_label() { #then host=${HOSTNAME} - if [[ $short_hostname = "on" ]]; then - host=`hostname -s` - fi + if [[ $short_hostname = "on" ]]; then + host=`hostname -s` + fi host=${host#$default_host} uphost=`echo ${host} | tr a-z A-Z` if [[ $upcase_hostname = "on" ]]; then -- cgit v1.2.3