Support help/usage
authorSiraaj Khandkar <siraaj@khandkar.net>
Mon, 16 Mar 2020 17:21:09 +0000 (13:21 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Mon, 16 Mar 2020 17:21:09 +0000 (13:21 -0400)
home/bin/fetch-covid-19-cases-usa-ny

index 603ce7f..95a039f 100755 (executable)
@@ -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/' \
This page took 0.026103 seconds and 4 git commands to generate.