Skip to content

fix duplicate img cli subcommand panic - #25

Merged
programmersd21 merged 1 commit into
programmersd21:mainfrom
Sreehari425:alias
Sep 18, 2026
Merged

programmersd21 merged 1 commit into
programmersd21:mainfrom
Sreehari425:alias

Conversation

@Sreehari425

@Sreehari425 Sreehari425 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

tl;dr

  • remove the redundant hidden Img command
  • retain img as an alias for set
  • prevent Clap from panicking at startup due to duplicate command names

Summary by Sourcery

Remove the redundant hidden image subcommand while preserving img compatibility through the set command alias.

Bug Fixes:

  • Prevent the CLI from panicking at startup by removing the duplicate hidden image command.

Enhancements:

  • Retain img as an alias for the existing set command.

Summary by CodeRabbit

  • Changes
    • Removed the hidden duplicate image-setting command.
    • Image-setting remains available through the supported Set command and its existing img alias.
    • Existing wallpaper preview behavior and options remain unchanged.

@sourcery-ai

sourcery-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Eliminates the duplicate Img command definition that caused Clap to panic during startup, consolidates command handling on Set, and preserves img as the backward-compatible alias.

File-Level Changes

Change Details Files
Remove the duplicate hidden command variant and consolidate execution on the existing set command while preserving img as its alias.
  • Delete the redundant hidden Img subcommand definition and its duplicated arguments.
  • Remove Commands::Img from command dispatch so Commands::Set handles the shared operation.
  • Keep the user-facing img compatibility alias through the existing set command alias configuration.
wallr-core/src/cli/mod.rs
wallr/src/main.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 7970511b-c4bc-4da0-a3f2-18713c4b2737

📥 Commits

Reviewing files that changed from the base of the PR and between f034e2e and ee8d2f7.

📒 Files selected for processing (2)
  • wallr-core/src/cli/mod.rs
  • wallr/src/main.rs
💤 Files with no reviewable changes (1)
  • wallr-core/src/cli/mod.rs

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change removes the hidden Img CLI variant and its duplicate handler path. The Set command remains the supported wallpaper command and retains the img alias.

Changes

Image command consolidation

Layer / File(s) Summary
Remove duplicate image command path
wallr-core/src/cli/mod.rs, wallr/src/main.rs
The hidden Commands::Img variant and match arm were removed. Commands::Set now provides the image-setting entry point with the existing handler logic.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: programmersd21

Merge Risk: ⚪ Minimal · up to ee8d2

The CLI consolidation preserves the supported image-setting command and removes the duplicate path, with no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removing the duplicate img CLI subcommand to prevent a startup panic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@sourcery-ai sourcery-ai Bot 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@programmersd21
programmersd21 merged commit 0b5d66a into programmersd21:main Sep 18, 2026
3 checks passed
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.

2 participants