giti: option short added again to support repo collector status

This commit is contained in:
Dirk Alders 2023-09-30 09:58:56 +02:00
parent 5fde2ca413
commit 33f1b70a13

8
giti
View File

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