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

Do not allow unknown flags when unnecessary #290

Merged
merged 3 commits into from Jan 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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