From 8e1d9f44b2b2bc4031693855478f7201a7681053 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Thu, 6 Feb 2020 15:04:34 -0500 Subject: improve docs --- cmd/metar.go | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'cmd') diff --git a/cmd/metar.go b/cmd/metar.go index 6355105..ea72f70 100644 --- a/cmd/metar.go +++ b/cmd/metar.go @@ -124,7 +124,7 @@ conjunction with --until`) `Ending time for METARs (e.g. "2020-01-01T01:31:00" or "3h"), used in conjunction with --since`) metarCmd.Flags().DurationVar( - &past, "past", 0, + &past, "past", time.Hour, `Duration to retrieve METARs since (e.g. "3h")`) // location constraints @@ -154,8 +154,8 @@ reported. A higher value results in less dense results.`) &mostRecentByStation, "most-recent-by-station", "constraint", `Method for fetching most recent for each station ("constraint", "postfilter", "false")`) - metarCmd.Flags().BoolVarP( - &mostRecent, "one", "1", false, + metarCmd.Flags().BoolVar( + &mostRecent, "most-recent", false, `Only fetch the single most recently-issued METAR of all the selected stations`) } @@ -173,19 +173,14 @@ var metarCmd = &cobra.Command{ if !since.t.IsZero() || !until.t.IsZero() { reqArgs = append(reqArgs, metar.TimeRange(since.t, until.t)) - } - - dur, _ := cmd.Flags().GetDuration("past") - if dur > 0 { + } else if dur, _ := cmd.Flags().GetDuration("past"); dur > 0 { reqArgs = append(reqArgs, metar.HoursBeforeNow(dur.Hours())) } - if mostRecentByStation != "" { - reqArgs = append(reqArgs, metar.MostRecentForEachStation(mostRecentByStation)) - } - if mostRecent { reqArgs = append(reqArgs, metar.MostRecent(true)) + } else if mostRecentByStation != "" { + reqArgs = append(reqArgs, metar.MostRecentForEachStation(mostRecentByStation)) } if !rect.IsZero() { -- cgit v1.2.3