funtoo / keychain

keychain ssh-agent front-end
http://www.funtoo.org
GNU General Public License v2.0
757 stars 107 forks source link

Hide keychain version on startup (except when called with --version flag) #132

Open finex opened 3 years ago

finex commented 3 years ago

Hi, currently every time the keychain script is invoked it prints the version and the funtoo.org link. I'd like to strip that row in order to compact the output. it should be printed only when the "--version" flag is used.

finex commented 3 years ago

Example patch:

diff --git a/keychain b/keychain
index 0eee68f..62cb2b8 100755
--- a/keychain
+++ b/keychain
@@ -1399,7 +1399,7 @@ fi
 $color || unset BLUE CYAN CYANN GREEN PURP OFF RED

 qprint #initial newline
-mesg "${PURP}keychain ${OFF}${CYANN}${version}${OFF} ~ ${GREEN}http://www.funtoo.org${OFF}"
+[ "$myaction" = version ] && { mesg "${PURP}keychain ${OFF}${CYANN}${version}${OFF} ~ ${GREEN}http://www.funtoo.org${OFF}"; }
 [ "$myaction" = version ] && { versinfo; exit 0; }
 [ "$myaction" = help ] && { versinfo; helpinfo; exit 0; }

diff --git a/keychain.sh b/keychain.sh
index f9465b3..5883ed1 100755
--- a/keychain.sh
+++ b/keychain.sh
@@ -1218,7 +1218,7 @@ fi
 $color || unset BLUE CYAN CYANN GREEN PURP OFF RED

 qprint #initial newline
-mesg "${PURP}keychain ${OFF}${CYANN}${version}${OFF} ~ ${GREEN}http://www.funtoo.org${OFF}"
+[ "$myaction" = version ] && { mesg "${PURP}keychain ${OFF}${CYANN}${version}${OFF} ~ ${GREEN}http://www.funtoo.org${OFF}"; }
 [ "$myaction" = version ] && { versinfo; exit 0; }
 [ "$myaction" = help ] && { versinfo; helpinfo; exit 0; }
mrl5 commented 2 years ago

hello @finex - if you'd like to report a bug kindly use https://bugs.funtoo.org/

you can also reach us on Discord - for more info check https://www.funtoo.org/Welcome

finex commented 2 years ago

Thank you very much @mrl5 :-)