The command name should default to CARGO_BIN_NAME #5738
Labels
A-derive
Area: #[derive]` macro API
C-enhancement
Category: Raise on the bar on expectations
M-breaking-change
Meta: Implementing or merging this will introduce a breaking change.
S-waiting-on-decision
Status: Waiting on a go/no-go before implementing
Milestone
Please complete the following tasks
Clap Version
4.5.9
Describe your use case
I want the default
-V / --version
to use the binary name instead of the package name, because this is the name users are familiar with. This situation happens when a project has both a library and a CLI. The CLI usually provides a binary with a different name than the package.The documentation says that the magic command attribute
name
defaults to the package name onParser
. I wonder if this was decided beforeCARGO_BIN_NAME
was a thing, or if it's just an oversight, or if there is a good reason to do so.Describe the solution you'd like
I'd like the default name to be
CARGO_BIN_NAME
instead ofCARGO_PKG_NAME
.Alternatives, if applicable
The obvious workaround is to specify a command name. This is completely fine, but the default is in my opinion wrong, so I'm creating an issue to understand the rationale.
Additional Context
No response
The text was updated successfully, but these errors were encountered: