Skip to content

Commit

Permalink
fix atlantis command help and usage
Browse files Browse the repository at this point in the history
  • Loading branch information
samtholiya committed Jan 16, 2025
1 parent 8fded4b commit fe0706c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/atlantis_generate_repo_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ var atlantisGenerateRepoConfigCmd = &cobra.Command{
Short: "Generate repository configuration for Atlantis",
Long: "Generate the repository configuration file required for Atlantis to manage Terraform repositories.",
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
handleHelpRequest(cmd, args)
if len(args) > 0 {
showUsageAndExit(cmd, args)
}
// Check Atmos configuration
checkAtmosConfig()
err := e.ExecuteAtlantisGenerateRepoConfigCmd(cmd, args)
Expand Down
16 changes: 16 additions & 0 deletions tests/test-cases/help-and-usage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,19 @@ tests:
stderr:
- "^$"
exit_code: 0
- name: atmos atlantis generate repo-config non-existant
enabled: true
description: "Should show usage for 'atmos atlantis generate repo-config non-existant'"
workdir: "../"
command: "atmos"
args:
- "atlantis"
- "generate"
- "repo-config"
- "--help"
expect:
stderr:
- "Error: Unknown command \"non-existant\" for \"atmos atlantis generate repo-config\""
stderr:
- "^$"
exit_code: 0

0 comments on commit fe0706c

Please sign in to comment.