Skip to content

✨ Add bsdtar-compatible verbose output for stdio subcommand#2702

Merged
ChanTsune merged 1 commit into
mainfrom
cli/stdio/create-extract/-v-support
Feb 7, 2026
Merged

✨ Add bsdtar-compatible verbose output for stdio subcommand#2702
ChanTsune merged 1 commit into
mainfrom
cli/stdio/create-extract/-v-support

Conversation

@ChanTsune
Copy link
Copy Markdown
Owner

@ChanTsune ChanTsune commented Feb 6, 2026

  • Create mode: prints "a " to stderr for each entry
  • Extract mode: prints "x " to stderr for each entry
  • Append mode: prints "a " to stderr for each entry
  • Update mode: prints "a " to stderr for each entry
  • Verbose output is controlled by -v flag, only for stdio subcommand
  • Regular create/extract/append/update commands are unaffected

Summary by CodeRabbit

  • New Features
    • Introduced verbose mode across archive operations. The command-line interface now supports optional verbose logging that displays detailed information about each entry being processed. Users can enable this feature during archive creation, appending, extraction, and update operations to gain enhanced visibility and transparency into CLI activities.

- Create mode: prints "a <path>" to stderr for each entry
- Extract mode: prints "x <path>" to stderr for each entry
- Append mode: prints "a <path>" to stderr for each entry
- Update mode: prints "a <path>" to stderr for each entry
- Verbose output is controlled by -v flag, only for stdio subcommand
- Regular create/extract/append/update commands are unaffected
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

The changes introduce verbose mode functionality across CLI archive operations (append, create, extract, update) by adding a verbose: bool parameter to relevant functions and data structures, enabling conditional per-entry logging during archive processing.

Changes

Cohort / File(s) Summary
Archive Command Handlers
cli/src/command/append.rs, cli/src/command/create.rs, cli/src/command/update.rs
Added verbose: bool parameter to archive operation functions (run_append_archive, create_archive_file, run_update_archive) with conditional logging that prints entry names when verbose mode is enabled.
Extract Output Configuration
cli/src/command/extract.rs
Added new verbose: bool field to OutputOption struct, defaulted to false, enabling optional verbose logging during extraction operations.
CLI Argument Propagation
cli/src/command/stdio.rs
Extended KeepOptions struct with new verbose: bool field and updated function signatures to thread verbosity flag from CLI arguments through archive operation call chains.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • ♻️ Capture metadata during filesystem collection #2564: Modifies the same archive command function signatures (run_append_archive, create_archive_file, run_update_archive) and related structures, adding complementary refactoring changes to CollectedItem types alongside this verbose parameter work.
  • @ support #2523: Updates the same CLI archive pipeline function signatures and call sites, threading additional parameters through the archive operation command chain similarly to how verbosity is being propagated.

Suggested labels

cli

Poem

🐰 A verbose whisper through the archive maze,
Each entry logged as the bunny plays,
Parameters thread from stdio's gaze,
Append, create, extract in sync—
Logging all the way to the brink! 📋

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 73.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding verbose output support to the stdio subcommand, which is the primary focus across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cli/stdio/create-extract/-v-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ChanTsune, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the stdio subcommand by adding a bsdtar-compatible verbose output feature. When the -v flag is used with stdio, the command will now print the action being performed ('a' for add/append/update, 'x' for extract) followed by the entry's path to standard error for each file processed. This provides users with clearer real-time feedback during archive operations, without altering the default, non-verbose behavior of the standard create, extract, append, and update commands.

Highlights

  • Verbose Output for stdio Subcommand: Introduced a new -v (verbose) flag specifically for the stdio subcommand, enabling detailed output during archive operations.
  • bsdtar-Compatible Output: Implemented verbose output that mimics bsdtar behavior: 'a ' is printed to stderr for each entry during create, append, and update operations, and 'x ' for extract operations.
  • Scope Limitation: The verbose output feature is strictly confined to the stdio subcommand; regular create, extract, append, and update commands remain unaffected and do not produce this verbose output.
  • Code Refactoring for Verbosity: Modified core archive handling functions (run_append_archive, create_archive_file, run_extract_archive_reader, run_update_archive) to accept a verbose boolean parameter, controlling the conditional printing to stderr.
Changelog
  • cli/src/command/append.rs
    • Added a verbose: bool parameter to the run_append_archive function.
    • Implemented conditional eprintln!("a {}") for each entry added to the archive when verbose is true.
    • Ensured append_to_archive calls run_append_archive with verbose: false to maintain default behavior.
  • cli/src/command/create.rs
    • Added a verbose: bool parameter to the create_archive_file function.
    • Implemented conditional eprintln!("a {}") for each entry added during solid and non-solid archive creation when verbose is true.
    • Ensured create_archive calls create_archive_file with verbose: false to maintain default behavior.
  • cli/src/command/extract.rs
    • Added a verbose: bool field to the OutputOption struct.
    • Implemented conditional eprintln!("x {}") for each entry extracted within run_extract_archive_reader when verbose is true.
    • Ensured extract_archive initializes OutputOption with verbose: false to maintain default behavior.
  • cli/src/command/stdio.rs
    • Modified run_create_archive, run_extract_archive, run_append, and run_update functions to pass the args.verbose flag from the stdio command arguments to their respective underlying archive handling functions, activating the new verbose output for stdio operations.
  • cli/src/command/update.rs
    • Added a verbose: bool parameter to both run_update_archive function overloads.
    • Implemented conditional eprintln!("a {}") for each entry added/updated in the archive when verbose is true.
    • Ensured update_archive calls run_update_archive with verbose: false to maintain default behavior.
Activity
  • The pull request introduces a new feature based on the title and description.
  • The changes involve modifying multiple command-line interface files to integrate a verbose output flag.
  • No explicit reviewer comments or discussions are available in the provided context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added the cli This issue is about cli application label Feb 6, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a bsdtar-compatible verbose output for the stdio subcommand, which is a great feature for providing more feedback to the user. The implementation correctly adds a verbose flag and passes it down from the stdio command handler, while keeping it disabled for other commands. The core logic for printing entry paths during various operations is sound. My review includes a couple of suggestions to address code duplication that has been introduced, aiming to improve the long-term maintainability of the code. Overall, this is a solid contribution.

Comment thread cli/src/command/create.rs
@ChanTsune ChanTsune merged commit 2905579 into main Feb 7, 2026
104 of 105 checks passed
@ChanTsune ChanTsune deleted the cli/stdio/create-extract/-v-support branch February 7, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli This issue is about cli application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant