-
Notifications
You must be signed in to change notification settings - Fork 156
dash in flags #771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dash in flags #771
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I wonder if we could use alias
also to make this change backwards compatible.
For example, we could
trait ArgExt {
// FIXME: better name
pub fn long_with_snake_alias(&mut self, arg: &'static str) -> Self;
}
impl ArgExt for clap::Arg {
pub fn long_with_snake_alias(&mut self, arg: &'static str) -> Self {
self.long(arg).alias(arg.to_snake_case())
}
}
Yes, clap supports aliases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the repetition and would prefer the long_with_snake_alias
approach but it's not a hard requirement.
I'd add that the reason we ended up using snake_case for multi word flags instead of kebab-case was just because we ended up doing it that way in #362
I think we've had discussions about this before but I can't find those discussions. Anyway, LGTM!
sorry! changelog line 12 should be changed |
No description provided.