Skip to content

Commit

Permalink
Bind pflags to default variable fields && Remove short flags as they'…
Browse files Browse the repository at this point in the history
…re not supported by pflags (flyteorg#124)

* * Bind pflags to default variable fields
* Remove short flags as they're not supported by pflags

Signed-off-by: Sean Lin <[email protected]>

* Add --default-var to config.go

Signed-off-by: Sean Lin <[email protected]>

* * merge change from master branch
* remove config_test as the generated test conflicts with it

Signed-off-by: Sean Lin <[email protected]>

* Add config_test.go to commit

Signed-off-by: Sean Lin <[email protected]>

* Update command help doc

Signed-off-by: Sean Lin <[email protected]>

* Use camelCase for flags

Signed-off-by: Sean Lin <[email protected]>

* Remove short flags from docs

Signed-off-by: Sean Lin <[email protected]>

* Update docs

Signed-off-by: Sean Lin <[email protected]>
  • Loading branch information
mayitbeegh authored Jul 9, 2021
1 parent 4769904 commit c2a9b5f
Show file tree
Hide file tree
Showing 96 changed files with 504 additions and 502 deletions.
2 changes: 1 addition & 1 deletion cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/flyteorg/flytectl/pkg/printer"
)

//go:generate pflags Config
//go:generate pflags Config --bind-default-var

var (
defaultConfig = &Config{}
Expand Down
6 changes: 3 additions & 3 deletions cmd/config/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package clusterresourceattribute

//go:generate pflags AttrDeleteConfig --default-var DefaultDelConfig
//go:generate pflags AttrDeleteConfig --default-var DefaultDelConfig --bind-default-var

// AttrDeleteConfig Matchable resource attributes configuration passed from command line
type AttrDeleteConfig struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package clusterresourceattribute

//go:generate pflags AttrFetchConfig --default-var DefaultFetchConfig
//go:generate pflags AttrFetchConfig --default-var DefaultFetchConfig --bind-default-var

type AttrFetchConfig struct {
AttrFile string `json:"attrFile" pflag:",attribute file name to be used for generating attribute for the resource type."`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package clusterresourceattribute

//go:generate pflags AttrUpdateConfig --default-var DefaultUpdateConfig
//go:generate pflags AttrUpdateConfig --default-var DefaultUpdateConfig --bind-default-var

// AttrUpdateConfig Matchable resource attributes configuration passed from command line
type AttrUpdateConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/config/subcommand/execution/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions cmd/config/subcommand/execution/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package executionclusterlabel

//go:generate pflags AttrDeleteConfig --default-var DefaultDelConfig
//go:generate pflags AttrDeleteConfig --default-var DefaultDelConfig --bind-default-var

// AttrDeleteConfig Matchable resource attributes configuration passed from command line
type AttrDeleteConfig struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package executionclusterlabel

//go:generate pflags AttrFetchConfig --default-var DefaultFetchConfig
//go:generate pflags AttrFetchConfig --default-var DefaultFetchConfig --bind-default-var

type AttrFetchConfig struct {
AttrFile string `json:"attrFile" pflag:",attribute file name to be used for generating attribute for the resource type."`
Expand Down
Loading

0 comments on commit c2a9b5f

Please sign in to comment.