Skip to content

Commit

Permalink
mcap info: add channel count (#1243)
Browse files Browse the repository at this point in the history
Merging #1051 with a small tweak to use Statistics's channel count if
available.

---------

Co-authored-by: peizhe.chen <[email protected]>
Co-authored-by: pezy <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2024
1 parent 0ebaf69 commit 4ec37c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/cli/mcap/cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ func printInfo(w io.Writer, info *mcap.Info) error {
return err
}
if info.Statistics != nil {
fmt.Fprintf(buf, "channels: %d\n", info.Statistics.ChannelCount)
fmt.Fprintf(buf, "attachments: %d\n", info.Statistics.AttachmentCount)
fmt.Fprintf(buf, "metadata: %d\n", info.Statistics.MetadataCount)
} else {
fmt.Fprintf(buf, "channels: unknown\n")
fmt.Fprintf(buf, "attachments: unknown\n")
fmt.Fprintf(buf, "metadata: unknown\n")
}
Expand Down

0 comments on commit 4ec37c5

Please sign in to comment.