From 69b47915b109aaf2aa560807ab545d1cc7603dfb Mon Sep 17 00:00:00 2001 From: Haoran Yi Date: Fri, 11 Feb 2022 17:30:39 -0600 Subject: [PATCH] minor fix for handling unsupported opt in script --- net/init-metrics.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/init-metrics.sh b/net/init-metrics.sh index efe81bb2d..f79cd065b 100755 --- a/net/init-metrics.sh +++ b/net/init-metrics.sh @@ -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\""