From 8ed7ace80f4af387eecfefea1ac1d81068656b32 Mon Sep 17 00:00:00 2001 From: Jiri Date: Sun, 26 Dec 2021 12:20:45 +0100 Subject: [PATCH] made launcehr ab it more verbose by default --- java-runtime-decompiler | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/java-runtime-decompiler b/java-runtime-decompiler index b765d90..9bc7c0a 100644 --- a/java-runtime-decompiler +++ b/java-runtime-decompiler @@ -7,6 +7,15 @@ . /usr/share/java-utils/java-functions +echo $@ | grep -q -e "-verbose" +verbose=$? + +function warning() { + if [ $verbose -eq 0 ] ; then + echo ${1} >&2 + fi +} + # identify directory tree JRD=`basename $0` CONF_HOME=$XDG_CONFIG_HOME @@ -58,7 +67,7 @@ for cpfile in $CP_FILES; do then cp $cpfile $PLUGIN_HOME else - echo "Configuration files were not copied for $FILE_NAME - the existing configuration would be overwritten." >&2 + warning "Configuration files were not copied for $FILE_NAME - the existing configuration would be overwritten." fi done @@ -69,11 +78,11 @@ if [ -e $AGENT ] then if grep -Fxq $AGENT_STRING $CONFIG_FILE then - echo "Default agent path is already set in $CONFIG_FILE. Skipping agent path setting." >&2 + warning "Default agent path is already set in $CONFIG_FILE. Skipping agent path setting." elif grep -rq $AGENT_PREFIX $CONFIG_FILE then RESULT_OF_GREP="$(grep -rq $AGENT_PREFIX $CONFIG_FILE)" - echo "Agent path is already set in $CONFIG_FILE as ${RESULT_OF_GREP}. Skipping agent path setting." >&2 + warning "Agent path is already set in $CONFIG_FILE as ${RESULT_OF_GREP}. Skipping agent path setting." else echo $AGENT_STRING >> $CONFIG_FILE