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

cli: Support multiple inputs in 'cat' #1331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wkalt
Copy link
Contributor

@wkalt wkalt commented Feb 8, 2025

This adds support to the mcap cat command for multiple input files. Multiple files can be directly supplied, like

mcap cat file1.mcap file2.mcap

or, the list of files may be auto-populated by your shell, enabling you to type

mcap cat **/*.mcap

This adds support to the `mcap cat` command for multiple input files.
Multiple files can be directly supplied, like

    mcap cat file1.mcap file2.mcap

or, the list of files may be auto-populated by your shell, enabling you
to type

    mcap cat **/*.mcap
@wkalt wkalt requested a review from james-rms as a code owner February 8, 2025 16:27
// stdin.
readingStdin := (stat.Mode()&os.ModeCharDevice == 0 && len(args) == 0)

// stdin is a special case, since we can't seek
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I rearranged this comment and moved the stdin-related stuff closer together.

@james-rms
Copy link
Collaborator

This seems ok, but I think it deserves a CLI doc change to describe what the behavior is. Before looking at the code and just looking at the PR title, I assumed you were extending cat to stream-merge input files and produce a time-ordered output stream, but that's not what's happening here.

Related - do you think it'd be worth supporting a --mcap output format so that there's a CLI tool which can logically concatenate the messages in several MCAP files into a single output MCAP, without merging?

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.

2 participants