Add `-h' option to print an header - wu - Prints hourly forecast for the next 48 hours using api.wunderground.com
(HTM) hg clone https://bitbucket.org/iamleot/wu
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset 7d89e52c2ad8a33960c09d15944abc1bc3fe470c
(DIR) parent bc82344d3ddb0b3befc05ac2e6856457390f2ab7
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Thu, 11 Jan 2018 12:53:54
Add `-h' option to print an header
Diffstat:
wu.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff -r bc82344d3ddb -r 7d89e52c2ad8 wu.sh
--- a/wu.sh Tue Jan 09 10:21:20 2018 +0100
+++ b/wu.sh Thu Jan 11 12:53:54 2018 +0100
@@ -37,6 +37,10 @@
req="http://api.wunderground.com/api/${apikey}/hourly/q/${city}.json"
+if [ $# -eq 1 ] && [ "$1" = "-h" ]; then
+ printf "Hour\t°C\tCondition\tProbability of precipitation\n"
+fi
+
curl -s $req | \
jq -r \
'.hourly_forecast[] |