aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md8
-rw-r--r--cmd/Main.hs4
2 files changed, 7 insertions, 5 deletions
diff --git a/README.md b/README.md
index 5269074..9de008a 100644
--- a/README.md
+++ b/README.md
@@ -23,14 +23,14 @@ Usage
```
Usage: openweathermap [(-K|--api-key-file APIKEYFILE) | (-k|--api-key APIKEY)]
- ((-c|--city CITY) | --lat NUM --lon NUM)
+ ((-q|--query STRING) | --lat NUM --lon NUM)
[(-n|--current) | (-f|--forecast)] [-d|--debug]
Available options:
-K,--api-key-file APIKEYFILE
Read API key from this file
-k,--api-key APIKEY API key
- -c,--city CITY City name
+ -q,--query STRING City name, e. g. Santiago or Santiago,CU
--lat NUM Latitude in decimal degrees
--lon NUM Longitude in decimal degrees
-n,--current current weather (default)
@@ -49,13 +49,13 @@ Examples
--------
```
-$ openweathermap -c norilsk
+$ openweathermap -q norilsk
Norilsk,RU (69.35°, 88.2°): Clouds, H 100 %, P 753 mmHg, T +4 °C, ↓ 1 m/s
$ openweathermap --lat 55.7522200 --lon 37.6155600
Moscow,RU (55.75°, 37.62°): Clear, H 45 %, P 762 mmHg, T +18..+21 °C, → 4 m/s
-$ openweathermap -c kaliningrad -f
+$ openweathermap -q kaliningrad -f
Kaliningrad,RU (54.7065°, 20.511°)
2020-04-19 17:00:00 +0200: Clear, H 66 %, P 767 mmHg, T +7 °C, ↓ 7 m/s
2020-04-19 20:00:00 +0200: Clear, H 79 %, P 768 mmHg, T +4 °C, ↓ 5 m/s
diff --git a/cmd/Main.hs b/cmd/Main.hs
index 6349dde..9fb5eb6 100644
--- a/cmd/Main.hs
+++ b/cmd/Main.hs
@@ -46,7 +46,9 @@ parseLocation = byName <|> byCoord
where
byName =
Client.Name <$>
- strOption (long "city" <> short 'c' <> metavar "CITY" <> help "City name")
+ strOption
+ (long "query" <> short 'q' <> metavar "STRING" <>
+ help "City name, e. g. Santiago or Santiago,CU")
byCoord =
Client.Coord <$>
option