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

Add target flags to target view command #289

Merged
merged 3 commits into from
May 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add target flags to gtv
  • Loading branch information
petersutter committed May 9, 2023
commit 184fa62170e361e1508cbc05b8a7d153b1e4cbe1
4 changes: 4 additions & 0 deletions pkg/cmd/target/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/gardener/gardenctl-v2/internal/util"
"github.com/gardener/gardenctl-v2/pkg/cmd/base"
"github.com/gardener/gardenctl-v2/pkg/flags"
)

// NewCmdView returns a new target view command.
Expand All @@ -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())
Copy link
Member

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.

Copy link
Member Author

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


return cmd
}

Expand Down