-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Merge atmos specific and terraform help documentation #857
Merge atmos specific and terraform help documentation #857
Conversation
I wonder why your terminal is not in color |
Oh, I see now I didn't realize we were not using cobra's built-in mechanism. Can you check why we are not using that because that means we have a very different implementation for this one off command! I like what you're doing more than what we had. However, it looks nothing like |
…-also-show-terraform-help
We have solved the wrapping issues in Cobra, so if we can get the menu back in there, that would be ideal. |
0fe021a
to
4379eda
Compare
💥 This pull request now has conflicts. Could you fix it @samtholiya? 🙏 |
b4b103a
to
26d25fd
Compare
@samtholiya thanks The tests are failing (looks like they all can't find the CLI flags), please look into that. |
832b8f1
to
ea2732f
Compare
…-also-show-terraform-help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
cmd/root.go (2)
125-141
: Refactor duplicate logo printing logic.The logo printing logic is duplicated in both conditional branches. Consider refactoring to improve maintainability:
RootCmd.SetHelpFunc(func(command *cobra.Command, strings []string) { fmt.Println() + err := tuiUtils.PrintStyledText("ATMOS") + if err != nil { + u.LogErrorAndExit(atmosConfig, err) + } + if command.Use != "atmos" { - err := tuiUtils.PrintStyledText("ATMOS") - if err != nil { - u.LogErrorAndExit(atmosConfig, err) - } if err := oldUsageFunc(command); err != nil { u.LogErrorAndExit(atmosConfig, err) } } else { - err := tuiUtils.PrintStyledText("ATMOS") - if err != nil { - u.LogErrorAndExit(atmosConfig, err) - } b.HelpFunc(command, strings) if err := command.Usage(); err != nil { u.LogErrorAndExit(atmosConfig, err) } }
143-143
: Consider moving update check earlier.The update check is performed after help display, which might delay the primary help information. Consider moving it before the help display to maintain focus on the help content.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
cmd/cmd_utils.go
(0 hunks)cmd/root.go
(2 hunks)
💤 Files with no reviewable changes (1)
- cmd/cmd_utils.go
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: [localstack] demo-localstack
- GitHub Check: Acceptance Tests (windows-latest, windows)
- GitHub Check: Summary
🔇 Additional comments (2)
cmd/root.go (2)
84-84
: LGTM! Clean error handling setup.The error variable declaration follows Go conventions and is well-scoped for the subsequent error handling blocks.
113-113
: Great function renaming!The rename from
initConfig()
toinitCobraConfig()
better reflects the function's specific responsibility of initializing Cobra configurations.
…-also-show-terraform-help
e1b0146
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
These changes were released in v1.137.0. |
what
Current:
After this change :
not supported
commandswhy
references
Summary by CodeRabbit
New Features
terraform
command.Bug Fixes
Documentation
Refactor