Skip to content

fix: show proper conflict error between --output and --remote-name#827

Merged
ryanfowler merged 1 commit into
mainfrom
fix/output-remote-name-conflict-error
Jul 2, 2026
Merged

fix: show proper conflict error between --output and --remote-name#827
ryanfowler merged 1 commit into
mainfrom
fix/output-remote-name-conflict-error

Conversation

@ryanfowler

Copy link
Copy Markdown
Owner

Summary

conflicts_with (singular) on the --output flag caused clap to emit a misleading error message when -o and -O were used together:

$ fetch -o /tmp/a -O https://example.com
error: flag '--output' cannot be used multiple times

Fix

Changed conflicts_with = "remote_name" to conflicts_with_all = ["remote_name"] on the output argument at src/cli.rs:399, matching the convention used by remote_name and discard. This makes the conflict definition symmetric, so clap now reports:

$ fetch -o /tmp/a -O https://example.com
error: flags '--output' and '--remote-name' cannot be used together

Validation

  • cargo build --locked
  • cargo test --locked --all-features --test cli — 14/14 passed
  • Manual smoke test with -o + -O produces the correct error message

Use `conflicts_with_all` on the `output` argument (matching `remote_name`) so clap reports 'flags cannot be used together' instead of the misleading 'flag cannot be used multiple times'.
@ryanfowler ryanfowler enabled auto-merge July 2, 2026 05:14
@ryanfowler ryanfowler merged commit c8084e1 into main Jul 2, 2026
7 of 8 checks passed
@ryanfowler ryanfowler deleted the fix/output-remote-name-conflict-error branch July 2, 2026 05:21
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.

1 participant