Skip to content

Modernize clap from 2.27.0 to 4.5 with derive API - #58

Open
bpblanken wants to merge 4 commits into
brentp:mainfrom
broadinstitute:benb/modernize_clap
Open

bpblanken wants to merge 4 commits into
brentp:mainfrom
broadinstitute:benb/modernize_clap

Conversation

@bpblanken

Copy link
Copy Markdown

Replace the old clap_app! macro with the modern derive-based approach. This simplifies the CLI definition, improves maintainability, and brings the dependency up to date. The functionality remains unchanged but the code is now more idiomatic and easier to extend.

Replace the old clap_app! macro with the modern derive-based approach. This simplifies the CLI definition, improves maintainability, and brings the dependency up to date. The functionality remains unchanged but the code is now more idiomatic and easier to extend.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

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

Copy link
Copy Markdown
Contributor

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 updates the clap dependency to version 4.5 and refactors the CLI argument parsing in src/main.rs to use the modern derive API instead of the deprecated clap_app! macro. Feedback on the changes suggests improving CLI usability by adding long flags (--echtvar and --include) to the optional arguments, and simplifying the Args struct attributes by removing the redundant long_about = None attribute.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/main.rs Outdated
Comment thread src/main.rs Outdated
bpblanken and others added 2 commits July 20, 2026 16:03
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the CLI layer by upgrading from clap v2’s clap_app! macro to clap v4.5’s derive-based API, aiming to keep the CLI behavior the same while making the command definition more maintainable.

Changes:

  • Replaced the clap_app! macro-based CLI definition with #[derive(Parser)] / #[derive(Subcommand)].
  • Updated Cargo.toml to use clap = 4.5 with the derive feature.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/main.rs Migrates CLI parsing to clap v4 derive structs/enums and updates dispatch to subcommand handlers.
Cargo.toml Updates the clap dependency to v4.5 and enables the derive feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main.rs
Comment thread Cargo.toml Outdated
@bpblanken
bpblanken requested a review from brentp July 21, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants