Browse Source

giti: option short added again to support repo collector status

master
Dirk Alders 1 year ago
parent
commit
33f1b70a13
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      giti

+ 6
- 2
giti View File

4
 #
4
 #
5
 # command line arguments
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
   case $options in
9
   case $options in
10
     p ) PROMPT="True";;
10
     p ) PROMPT="True";;
11
+    s ) SHORT="True";;
11
     h ) echo $usage
12
     h ) echo $usage
12
         exit 0
13
         exit 0
13
         ;;
14
         ;;
75
 if [[ $PROMPT ]]; then
76
 if [[ $PROMPT ]]; then
76
   # print status
77
   # print status
77
   echo -e "$git_status_color├──$COLOR_GREEN($git_branch)$git_status_color - $git_status_text - $COLOR_CYAN$git_url$COLOR_WHITE"
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
 else
82
 else
79
   # print status and 
83
   # print status and 
80
   echo -e "$git_status_color┌───┤ $git_status_text ├────────────────────────────────────────────────────────────────"
84
   echo -e "$git_status_color┌───┤ $git_status_text ├────────────────────────────────────────────────────────────────"

Loading…
Cancel
Save