Merge pull request #644 from PJungkamp/villas-shell-quoting
tools/villas: improve script behaviour for `-h` or `--help`
This commit is contained in:
commit
ff863007d7
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue