Improve run-example.sh

- More usage example
- Newlines for prettier output
This commit is contained in:
Trustin Lee 2014-05-20 23:38:53 +09:00
parent 72ccf83861
commit 50ae950203

View File

@ -30,11 +30,14 @@ done
if [[ -z "$EXAMPLE" ]] || [[ -z "$EXAMPLE_CLASS" ]] || [[ $# -ne 0 ]]; then if [[ -z "$EXAMPLE" ]] || [[ -z "$EXAMPLE_CLASS" ]] || [[ $# -ne 0 ]]; then
echo " Usage: $0 [-D<name>[=<value>] ...] <example-name>" >&2 echo " Usage: $0 [-D<name>[=<value>] ...] <example-name>" >&2
echo "Example: $0 -Dport=8443 -Dssl http-server" >&2 echo "Example: $0 -Dport=8443 -Dssl http-server" >&2
echo " $0 -Dhost=127.0.0.1 -Dport=8009 echo-client" >&2
echo >&2 echo >&2
echo "Available examples:" >&2 echo "Available examples:" >&2
echo >&2
for E in "${!EXAMPLE_MAP[@]}"; do for E in "${!EXAMPLE_MAP[@]}"; do
echo " $E" echo " $E"
done | sort >&2 done | sort >&2
echo >&2
exit 1 exit 1
fi fi