From 33f1b70a13f61da76038e72a9c90cdd875520a1c Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sat, 30 Sep 2023 09:58:56 +0200 Subject: [PATCH] giti: option short added again to support repo collector status --- giti | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/giti b/giti index 160431a..2c80c80 100755 --- a/giti +++ b/giti @@ -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 ├────────────────────────────────────────────────────────────────"