From fe692269382e389d8e773132fb5a5cd1bcaccb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Lhez?= Date: Thu, 27 Aug 2015 21:52:40 +0200 Subject: [PATCH] fix: sed s/\n/|/g did not work, need some sed voodoo magic (http://www.grymoire.com/Unix/Sed.html#uh-nl) --- bash_completion.bash | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bash_completion.bash b/bash_completion.bash index fb94fce..1f44554 100755 --- a/bash_completion.bash +++ b/bash_completion.bash @@ -187,8 +187,7 @@ _mvn() local plugin_goals_wildfly="wildfly:add-resource|wildfly:deploy|wildfly:deploy-only|wildfly:deploy-artifact|wildfly:redeploy|wildfly:redeploy-only|wildfly:undeploy|wildfly:undeploy-artifact|wildfly:run|wildfly:start|wildfly:shutdown|wildfly:execute-commands" ## some plugin (like jboss-as) has '-' which is not allowed in shell var name, to use '_' then replace - local common_plugins=`compgen -v | \grep "^plugin_goals_.*" | sed -e 's/plugin_goals_//g' -e 's/_/-/g' -e 's@\n@|@g'` - + local common_plugins=`compgen -v | \grep "^plugin_goals_.*" | sed -e 's/plugin_goals_//g' -e 's/_/-/g' | tr '\n' '|'` local options="-Dmaven.test.skip=true|-DskipTests|-DskipITs|-Dtest|-Dit.test|-DfailIfNoTests|-Dmaven.surefire.debug|-DenableCiProfile|-Dpmd.skip=true|-Dcheckstyle.skip=true|-Dtycho.mode=maven|-Dmaven.javadoc.skip=true|-Dgwt.compiler.skip|-Dcobertura.skip=true|-Dfindbugs.skip=true||-DperformRelease=true|-Dgpg.skip=true|-DforkCount" local OIFS=$IFS @@ -200,11 +199,11 @@ _mvn() elif [[ ${prev} == -P || ${prev} == --activate-profiles ]] ; then IFS=$OIFS - local profile_settings=`[ -e ~/.m2/settings.xml ] && \grep -e "" -A 1 ~/.m2/settings.xml | \grep -e ".*" | sed -e 's/.*//' -e 's/<\/id>.*//g' -e 's@\n@|@g' ` + local profile_settings=`[ -e ~/.m2/settings.xml ] && \grep -e "" -A 1 ~/.m2/settings.xml | \grep -e ".*" | sed -e 's/.*//' -e 's/<\/id>.*//g' | tr '\n' '|' ` local profiles="${profile_settings}|" for item in ${POM_HIERARCHY[*]} do - local profile_pom=`[ -e $item ] && \grep -e "" -A 1 $item | \grep -e ".*" | sed -e 's/.*//' -e 's/<\/id>.*//g' -e 's@\n@|@g' ` + local profile_pom=`[ -e $item ] && \grep -e "" -A 1 $item | \grep -e ".*" | sed -e 's/.*//' -e 's/<\/id>.*//g' | tr '\n' '|'` local profiles="${profiles}|${profile_pom}" done