diff options
Diffstat (limited to 'weather.go')
-rw-r--r-- | weather.go | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -17,6 +17,12 @@ const bbcdefid = "2654675" const meturl = "https://www.metoffice.gov.uk/public/data/PWSCache/BestForecast/Forecast/%s.json?concise=true" const bbcurl = "https://weather-broker-cdn.api.bbci.co.uk/en/forecast/aggregated/%s" +const usage = `Usage: weather [-s source] [-v] [locationid] + +weather shows the weather forecast for a location. Read the README +for instructions on finding your location ID. +` + const mpsToMphMultiplier = 2.23693629 // BBC structures @@ -143,7 +149,6 @@ type Weather struct { var ( src = flag.String("s", "bbc", "data source provider (valid options: 'bbc', 'metoffice')") - numdays = flag.Int("n", 2, "number of days to show") verbose = flag.Bool("v", false, "verbose: show all weather details") ) @@ -217,6 +222,10 @@ func main() { var resp *http.Response var weather []Weather + flag.Usage = func() { + fmt.Fprintf(flag.CommandLine.Output(), usage) + flag.PrintDefaults() + } flag.Parse() switch *src { |