Skip to content
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

Support aliases for flags #409

Merged
merged 4 commits into from
Feb 27, 2024

Conversation

prashantv
Copy link
Contributor

Fixes #303

Aliases are currently only supported for sub-commands, but they're useful for flags as well. E.g., when migrating from an old flag name to a new flag name, while still supporting the old value.

@prashantv
Copy link
Contributor Author

@alecthomas Sorry for the direct ping, is this functionality something you'd be open to supporting in kong?

There's been a few cases where I've wanted to migrate away from an flag name to a better name, but keep backwards compatibility.

Copy link
Owner

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the delay, I somehow missed this PR.

I think adding flag aliases is a great idea, just one change please.

context.go Outdated Show resolved Hide resolved
@prashantv prashantv force-pushed the prashant/flag-alias branch 2 times, most recently from d64b825 to 644b540 Compare February 26, 2024 22:47
@alecthomas
Copy link
Owner

LGTM! Fix up the linting and I'll merge it in, thanks very much for doing this.

@prashantv
Copy link
Contributor Author

Done, thanks for the review!

Fixes alecthomas#303

Aliases are currently only supported for sub-commands, but they're
useful for flags as well. E.g., when migrating from an old flag name
to a new flag name, while still supporting the old value.
@alecthomas alecthomas merged commit fa9b636 into alecthomas:master Feb 27, 2024
5 checks passed
@prashantv prashantv deleted the prashant/flag-alias branch March 31, 2024 04:04
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.

Support aliases for all switches
2 participants