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
Codespaces: Use -R for --repo shorthand and deprecate -r #6725
Conversation
|
||
// addDeprecatedRepoShorthand adds a -r parameter (deprecated shorthand for --repo) | ||
// which instructs the user to use -R instead. | ||
func addDeprecatedRepoShorthand(cmd *cobra.Command, target *string) error { |
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.
If there are any suggestions for how to make this cleaner, I would love to improve this 😄 I couldn't figure out a way to mark -r
as deprecated and still have -R
added
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.
This makes sense to me
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.
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.
pkg/cmd/codespace/common.go
|
||
// addDeprecatedRepoShorthand adds a -r parameter (deprecated shorthand for --repo) | ||
// which instructs the user to use -R instead. | ||
func addDeprecatedRepoShorthand(cmd *cobra.Command, target *string) error { |
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.
This makes sense to me
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.
Looks like a fair approach given what tools Cobra provides. Thanks for doing this!
Related: #6548
The
codespaces
commands use-r
as shorthand for--repo
which is inconsistent with other commands which use-R
instead. This change updates existing usage of-r
to be-R
and marks usage of-r
as hidden and deprecated.Examples:
-R
exists and-r
is hidden:-R
works like--repo
:-r
still works, but warns about deprecation:Note that part of the motivation to make this change is to make #6548 more friendly - it removes a collision of
-r
ingh cs cp
for that change.