From: Siraaj Khandkar Date: Mon, 16 Mar 2020 17:21:09 +0000 (-0400) Subject: Support help/usage X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=14831832aec19b7f271522923de1953b02bc92a8;p=khome.git Support help/usage --- diff --git a/home/bin/fetch-covid-19-cases-usa-ny b/home/bin/fetch-covid-19-cases-usa-ny index 603ce7f..95a039f 100755 --- a/home/bin/fetch-covid-19-cases-usa-ny +++ b/home/bin/fetch-covid-19-cases-usa-ny @@ -5,9 +5,46 @@ # - awk # - hxpipe (packaged in html-xml-utils on Debian and Ubuntu) +VALID_LOCATIONS=' + Albany + Broome + Delaware + Dutchess + Erie + Greene + Herkimer + Monroe + Montgomery + Nassau + Orange + Putnam + Rockland + Saratoga + Schenectady + Suffolk + Tioga + Tompkins + Ulster + Westchester + New York State (Outside of NYC) + New York City: + Total Positive Cases (Statewide) + ' +DEFAULT_LOCATION='New York City:' + +usage() { + printf "Usage: %s [LOCATION]\n" "$0" + printf '\n' + printf 'LOCATION =' + printf '%s\n' "$VALID_LOCATIONS" + printf "Default LOCATION:\n %s\n" "$DEFAULT_LOCATION" + exit 1 +} + case "$1" in - '') location='New York City:';; - *) location="$1";; + '-h') usage;; + '' ) location="$DEFAULT_LOCATION";; + * ) location="$1";; esac curl 'https://health.ny.gov/diseases/communicable/coronavirus/' \