Skip to content

Commit

Permalink
Do not allow unknown flags when unnecessary (#290)
Browse files Browse the repository at this point in the history
* Do not allow unknown flags when unnecessary

* Auto Format

Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>
Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 1, 2023
1 parent 3b62c54 commit 3a43ea0
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/atlantis_generate.go
Expand Up @@ -9,7 +9,7 @@ var atlantisGenerateCmd = &cobra.Command{
Use: "generate",
Short: "Execute 'atlantis generate' commands",
Long: "This command generates various Atlantis configurations",
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/atlantis_generate_repo_config.go
Expand Up @@ -11,7 +11,7 @@ var atlantisGenerateRepoConfigCmd = &cobra.Command{
Use: "repo-config",
Short: "Execute 'atlantis generate repo-config`",
Long: "This command generates repository configuration for Atlantis",
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Run: func(cmd *cobra.Command, args []string) {
err := e.ExecuteAtlantisGenerateRepoConfigCmd(cmd, args)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/describe.go
Expand Up @@ -9,7 +9,7 @@ var describeCmd = &cobra.Command{
Use: "describe",
Short: "Execute 'describe' commands",
Long: `This command shows configuration for CLI, stacks and components`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/describe_affected.go
Expand Up @@ -12,7 +12,7 @@ var describeAffectedCmd = &cobra.Command{
Use: "affected",
Short: "Execute 'describe affected' command",
Long: `This command produces a list of the affected Atmos components and stacks given two Git commits: atmos describe stacks [options]`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Run: func(cmd *cobra.Command, args []string) {
err := e.ExecuteDescribeAffectedCmd(cmd, args)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/describe_component.go
Expand Up @@ -11,7 +11,7 @@ var describeComponentCmd = &cobra.Command{
Use: "component",
Short: "Execute 'describe component' command",
Long: `This command shows configuration for an atmos component in a stack: atmos describe component <component> -s <stack>`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Run: func(cmd *cobra.Command, args []string) {
err := e.ExecuteDescribeComponentCmd(cmd, args)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/describe_config.go
Expand Up @@ -11,7 +11,7 @@ var describeConfigCmd = &cobra.Command{
Use: "config",
Short: "Execute 'describe config' command",
Long: `This command shows the final (deep-merged) CLI configuration: atmos describe config`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Run: func(cmd *cobra.Command, args []string) {
err := e.ExecuteDescribeConfigCmd(cmd, args)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/describe_stacks.go
Expand Up @@ -11,7 +11,7 @@ var describeStacksCmd = &cobra.Command{
Use: "stacks",
Short: "Execute 'describe stacks' command",
Long: `This command shows configuration for atmos stacks and components in the stacks: atmos describe stacks [options]`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Run: func(cmd *cobra.Command, args []string) {
err := e.ExecuteDescribeStacksCmd(cmd, args)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/helmfile_generate.go
Expand Up @@ -9,7 +9,7 @@ var helmfileGenerateCmd = &cobra.Command{
Use: "generate",
Short: "Execute 'helmfile generate' commands",
Long: "This command generates configurations for helmfile components",
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/terraform_generate.go
Expand Up @@ -9,7 +9,7 @@ var terraformGenerateCmd = &cobra.Command{
Use: "generate",
Short: "Execute 'terraform generate' commands",
Long: "This command generates configurations for terraform components",
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
}

func init() {
Expand Down

0 comments on commit 3a43ea0

Please sign in to comment.