1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

update villas helper

This commit is contained in:
Steffen Vogel 2021-09-21 16:13:28 +02:00
parent 78577fcf1a
commit 6a293ed0b1
2 changed files with 6 additions and 8 deletions

View file

@ -39,7 +39,7 @@ install(
)
install(
PROGRAMS villas.sh
PROGRAMS villas
COMPONENT bin
DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME villas

View file

@ -27,21 +27,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
###################################################################################
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}