Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/observe: improve help message for date formats of --since/--until #956

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

rolinh
Copy link
Member

@rolinh rolinh commented Mar 23, 2023

The help message for the --since and --until flags of the observe 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), both Z07: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 replaces Z 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.

The help message for the `--since` and `--until` flags of the `observe`
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),
both `Z07: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
replaces `Z` 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.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
@rolinh rolinh added 📄 area/documentation Impacts the documentation, including textual changes, sphinx, or other doc generation code. kind/enhancement This would improve or streamline existing functionality. labels Mar 23, 2023
@rolinh rolinh requested a review from a team as a code owner March 23, 2023 13:30
@rolinh rolinh requested review from chancez and removed request for a team March 23, 2023 13:31
@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-release-note-label PR is blocked until the release note is set labels Mar 23, 2023
@rolinh rolinh added the release-note/misc This PR makes changes that have no direct user impact. label Mar 23, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label PR is blocked until the release note is set label Mar 23, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 23, 2023
@rolinh rolinh merged commit 1aed4e4 into master Mar 24, 2023
@rolinh rolinh deleted the pr/rolinh/improve-since-until-help branch March 24, 2023 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 area/documentation Impacts the documentation, including textual changes, sphinx, or other doc generation code. kind/enhancement This would improve or streamline existing functionality. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants