瀏覽代碼

giti: option short added again to support repo collector status

master
Dirk Alders 1 年之前
父節點
當前提交
33f1b70a13
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6
    2
      giti

+ 6
- 2
giti 查看文件

@@ -4,10 +4,11 @@
4 4
 #
5 5
 # command line arguments
6 6
 #
7
-usage="Usage: $0 [-p | output for prompt]"
8
-while getopts "hp" options; do
7
+usage="Usage: $0 [-p | output for prompt] [-s | short output]"
8
+while getopts "hps" options; do
9 9
   case $options in
10 10
     p ) PROMPT="True";;
11
+    s ) SHORT="True";;
11 12
     h ) echo $usage
12 13
         exit 0
13 14
         ;;
@@ -75,6 +76,9 @@ fi
75 76
 if [[ $PROMPT ]]; then
76 77
   # print status
77 78
   echo -e "$git_status_color├──$COLOR_GREEN($git_branch)$git_status_color - $git_status_text - $COLOR_CYAN$git_url$COLOR_WHITE"
79
+elif [[ $SHORT ]]; then
80
+  echo -n -e "$COLOR_GREEN($git_branch)$git_status_color - $git_status_text $COLOR_WHITE"
81
+  exit 0
78 82
 else
79 83
   # print status and 
80 84
   echo -e "$git_status_color┌───┤ $git_status_text ├────────────────────────────────────────────────────────────────"

Loading…
取消
儲存