minor fix for handling unsupported opt in script

This commit is contained in:
Haoran Yi 2022-02-11 17:30:39 -06:00 committed by Michael Vines
parent c04438be4b
commit 69b47915b1
1 changed files with 4 additions and 4 deletions

View File

@ -30,9 +30,9 @@ useEnv=false
delete=false
createWithoutConfig=false
host="https://internal-metrics.solana.com:8086"
while getopts "hdec:" opt; do
while getopts ":hdec:" opt; do
case $opt in
h|\?)
h)
usage
exit 0
;;
@ -47,7 +47,7 @@ while getopts "hdec:" opt; do
useEnv=true
;;
*)
usage "unhandled option: $opt"
usage "unhandled option: $OPTARG"
;;
esac
done
@ -77,7 +77,7 @@ else
"$host/query?u=${username}&p=${password}" \
--data-urlencode "q=$*"
}
query "DROP DATABASE \"$netBasename\""
! $delete || exit 0
query "CREATE DATABASE \"$netBasename\""