-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add target flags to target
view
command
#289
Conversation
fdd8d9d
to
555b7c0
Compare
555b7c0
to
0e2cd38
Compare
@@ -35,6 +36,9 @@ func NewCmdView(f util.Factory, ioStreams util.IOStreams) *cobra.Command { | |||
|
|||
o.AddFlags(cmd.Flags()) | |||
|
|||
f.TargetFlags().AddFlags(cmd.Flags()) | |||
flags.RegisterCompletionFuncsForTargetFlags(cmd, f, ioStreams, cmd.Flags()) |
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.
Not related to this PR but why do we pass the flagset to this function. It is not used. The flags must already be registered. And I think it was a very bad idea to name this package flags
which always create a name conflict if you want to have variable named flags. I anyway think it should be part of the same package the TargetFlags belongs to.
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.
true, I have created an issue for it #296
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.
/lgtm
What this PR does / why we need it:
This PR adds target flags to the
target
view
command.This is beneficial when gardenctl is used within a script, and the script needs to determine the current target while also taking the target flags into account.
Which issue(s) this PR fixes:
Fixes #286
Special notes for your reviewer:
Release note: