Skip to content

Commit

Permalink
example hint updated
Browse files Browse the repository at this point in the history
  • Loading branch information
samtholiya committed Jan 23, 2025
1 parent 06353a5 commit 018793e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/atlantis.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ var atlantisCmd = &cobra.Command{
}

func init() {
atlantisCmd.PersistentFlags().Bool("", false, doubleDashHint)
RootCmd.AddCommand(atlantisCmd)
}
1 change: 1 addition & 0 deletions cmd/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ var awsCmd = &cobra.Command{
}

func init() {
awsCmd.PersistentFlags().Bool("", false, doubleDashHint)
RootCmd.AddCommand(awsCmd)
}
1 change: 1 addition & 0 deletions cmd/helmfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func init() {
// https://github.com/spf13/cobra/issues/739
helmfileCmd.DisableFlagParsing = true
helmfileCmd.PersistentFlags().StringP("stack", "s", "", "atmos helmfile <helmfile_command> <component> -s <stack>")
helmfileCmd.PersistentFlags().Bool("", false, doubleDashHint)
RootCmd.AddCommand(helmfileCmd)
}

Expand Down
2 changes: 2 additions & 0 deletions cmd/markdown_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type ExampleContent struct {
Suggestion string
}

var doubleDashHint string = "Double dashes can be used to signify the end of Atmos-specific options and the beginning of additional native arguments and flags for the specific command being run."

var examples map[string]ExampleContent = map[string]ExampleContent{
"atmos_terraform": {
Content: terraform,
Expand Down
2 changes: 2 additions & 0 deletions cmd/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var terraformCmd = &cobra.Command{
Short: "Execute Terraform commands (e.g., plan, apply, destroy) using Atmos stack configurations",
Long: `This command allows you to execute Terraform commands, such as plan, apply, and destroy, using Atmos stack configurations for consistent infrastructure management.`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
Example: `atmos terraform [sub-command] <component> -s <stack>`,
PostRunE: func(cmd *cobra.Command, args []string) error {
info := getConfigAndStacksInfo("terraform", cmd, args)
return hooks.RunE(cmd, args, &info)
Expand Down Expand Up @@ -50,6 +51,7 @@ func init() {
// https://github.com/spf13/cobra/issues/739
terraformCmd.DisableFlagParsing = true
terraformCmd.PersistentFlags().StringP("stack", "s", "", "atmos terraform <terraform_command> <component> -s <stack>")
terraformCmd.PersistentFlags().Bool("", false, doubleDashHint)
attachTerraformCommands(terraformCmd)
RootCmd.AddCommand(terraformCmd)
}
2 changes: 1 addition & 1 deletion tests/test-cases/help-and-usage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -566,4 +566,4 @@ tests:
- "--check"
- "--non-existent"
expect:
exit_code: 1
exit_code: 1

0 comments on commit 018793e

Please sign in to comment.