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
#
usage="Usage: $0 [-p | output for prompt]"
while getopts "hp" options; do
usage="Usage: $0 [-p | output for prompt] [-s | short output]"
while getopts "hps" options; do
case $options in
p ) PROMPT="True";;
s ) SHORT="True";;
h ) echo $usage
exit 0
;;
@ -75,6 +76,9 @@ fi
if [[ $PROMPT ]]; then
# print status
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
# print status and
echo -e "$git_status_color┌───┤ $git_status_text ├────────────────────────────────────────────────────────────────"