Skip to content

CLI: accept RFC3339-formatted dates in relevant arguments #1263

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

Conversation

james-rms
Copy link
Collaborator

@james-rms james-rms commented Oct 30, 2024

Changelog

Added

CLI: mcap add attachment accepts RFC3339-formatted dates to specify the log and creation times for the new attachment.
CLI: mcap filter accepts RFC3339-formatted dates for start and end times.

Docs

None.

Description

Adds the ability for users to specify a date when filtering MCAP files, or adding attachments.

I did a quick pass to see if there are any other arguments where we accept a date or date-like value, I can't see any more.

@james-rms james-rms requested a review from jtbandes October 30, 2024 02:52
Copy link

linear bot commented Oct 30, 2024

@james-rms james-rms force-pushed the james/fg-9191-mcap-cli-accept-iso-8601-timestamps-for-filter-args branch from 20552cd to 11e3094 Compare October 30, 2024 02:59
@@ -416,6 +441,18 @@ usage:
0,
"messages with log times before nanosecond-precision timestamp will be included.",
)
startDate := filterCmd.PersistentFlags().String(
"start-date",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit start-datetime? Since it is both a date and time? Probably I'd even say that start is sufficient and can accept the start string as RFC3339 or the nanosecond variant. Not "real" reason that the program can't figure it out between those two formatss

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should start and start-secs accept an RFC3339 formatted timestamp in that world?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start-secs I'd have a harder time making an argument for given it says "secs". start seems to be asking for flexible support input formats

@@ -187,11 +195,19 @@ func init() {
addAttachmentCmd.PersistentFlags().StringVarP(
&addAttachmentMediaType, "content-type", "", "application/octet-stream", "content type of attachment",
)
addAttachmentCmd.PersistentFlags().Uint64VarP(
&addAttachmentLogTime, "log-time", "", 0, "attachment log time in nanoseconds (defaults to current timestamp)",
addAttachmentCmd.PersistentFlags().StringVarP(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think these are fine on a single line and easier to read

Copy link
Contributor

@defunctzombie defunctzombie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 from me on the user-facing aspects of this. Will let some golang wizards do the code review part.

@james-rms james-rms merged commit ba3c9c0 into main Nov 4, 2024
23 checks passed
@james-rms james-rms deleted the james/fg-9191-mcap-cli-accept-iso-8601-timestamps-for-filter-args branch November 4, 2024 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants