cmd/observe: improve help message for date formats of --since/--until #956
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The help message for the
--since
and--until
flags of theobserve
command was misleading. To provide an example of each supported time format, Go time's layout format was used. However, the layout doesn't correspond to an actually valid time when the time zone is used. This is because to instruct Go's time formatting to use Z for the UTC timezone and a±hh:mm
offset format otherwise (following the ISO8601 behavior), bothZ07:00
needs to be provided which, in itself, is an invalid timezone indicator as it means UTC (offset 00:00) and an offset of -07:00. To address this problem and improve the help output, this patch replacesZ
in the formatting string by-
so that the example formats print with the help are actually valid examples. Note that the help message for--time-format
is unchanged as in this case, a Go's time format string needs to be provided, not an actual date time string.