Skip to content

Commit

Permalink
Merge pull request #644 from PJungkamp/villas-shell-quoting
Browse files Browse the repository at this point in the history
tools/villas: improve script behaviour for `-h` or `--help`
  • Loading branch information
stv0g authored May 26, 2023
2 parents 7506e2c + c194b62 commit ff86300
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/villas
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand All @@ -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}

0 comments on commit ff86300

Please sign in to comment.