Combine long_flag and long_flag_aliases into one API? #5138
Labels
A-builder
Area: Builder 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-design
Status: Waiting on user-facing design to be resolved before implementing
Clap currently has https://docs.rs/clap/latest/clap/struct.Command.html#method.long_flag and https://docs.rs/clap/latest/clap/struct.Command.html#method.long_flag_aliases where
long_flag_aliases
does nothing withoutlong_flag
being specified. One could add a runtime warning/crash, but it's usually better to make bad states unrepresentable.The proposed solution is to unify these APIs into along_flags
method.Actually, the reason the "alias" method variants exist is to allow having hidden long flags that don't show up in help. I think the next best solution to use a builder pattern to only allow calling the alias variants after having specified the base long flag.
The text was updated successfully, but these errors were encountered: