-
Notifications
You must be signed in to change notification settings - Fork 125
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
CLI: accept RFC3339-formatted dates in relevant arguments #1263
Conversation
20552cd
to
11e3094
Compare
go/cli/mcap/cmd/filter.go
Outdated
@@ -416,6 +441,18 @@ usage: | |||
0, | |||
"messages with log times before nanosecond-precision timestamp will be included.", | |||
) | |||
startDate := filterCmd.PersistentFlags().String( | |||
"start-date", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
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.