diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index dd4d60c37..fd5e39d69 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -39,7 +39,7 @@ install( ) install( - PROGRAMS villas.sh + PROGRAMS villas COMPONENT bin DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME villas diff --git a/tools/villas.sh b/tools/villas similarity index 86% rename from tools/villas.sh rename to tools/villas index 62ee214f2..c5e27c0b4 100755 --- a/tools/villas.sh +++ b/tools/villas @@ -27,21 +27,19 @@ # along with this program. If not, see . ################################################################################### -PREFIX=villas - # Get a list of all available tools -TOOLS=$(compgen -c | egrep "^$PREFIX-" | sort -u | cut -d- -f2- | paste -sd'|') +SUBTOOLS="node compare pipe hook conf2json convert graph relay signal test-config test-rtt zmq-keygen" # First argument to wrapper is the tool which should be started -TOOL=$1 +SUBTOOL=$1 # Following arguments will be passed directly to tool ARGS=${@:2} # Check if tool is available -if ! [[ "$TOOL" =~ $(echo ^\($TOOLS\)$) ]]; then +if ! echo ${SUBTOOLS} | grep -w -q ${SUBTOOL}; then echo "Usage: villas [TOOL]" - echo " TOOL is one of ${TOOLS}" + echo " TOOL is one of ${SUBTOOLS}" echo echo "For detailed documentation, please see: 'villas node'" echo " http://villas.fein-aachen.org/doc/" @@ -52,4 +50,4 @@ if ! [[ "$TOOL" =~ $(echo ^\($TOOLS\)$) ]]; then exit 1 fi -exec $PREFIX-$TOOL $ARGS +exec villas-${SUBTOOL} ${ARGS}