Merge pull request #644 from PJungkamp/villas-shell-quoting

tools/villas: improve script behaviour for `-h` or `--help`
This commit is contained in:
Steffen Vogel 2023-05-26 03:01:46 +02:00 committed by GitHub
commit ff863007d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -22,8 +22,8 @@ SUBTOOL=$1
ARGS=${@:2}
# Check if tool is available
if ! echo ${SUBTOOLS} | grep -w -q ${SUBTOOL}; then
echo "Usage: villas [TOOL]"
if ! echo ${SUBTOOLS} | grep -wqFe "${SUBTOOL}"; then
echo "Usage: villas [-h | --help | TOOL]"
echo " TOOL is one of ${SUBTOOLS}"
echo
echo "For detailed documentation, please see: 'villas node'"
@ -32,7 +32,8 @@ if ! echo ${SUBTOOLS} | grep -w -q ${SUBTOOL}; then
# Show VILLASnode copyright and contact info
villas-node -h | tail -n3
exit 1
echo "-h" "--help" | grep -wqFe "${SUBTOOL}"
exit $?
fi
exec villas-${SUBTOOL} ${ARGS}