Skip to content

Commit

Permalink
Fix: condition to display help interactive menu (#724)
Browse files Browse the repository at this point in the history
* fix: condition to display help interactive menu

* chore: clean code improve readability

* fix: change flag in help command

* Add `--stack` flag to `atmos describe affected` command

---------

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
Co-authored-by: aknysh <andriy.knysh@gmail.com>
  • Loading branch information
4 people authored Oct 19, 2024
1 parent a94f9f6 commit c866ab5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
16 changes: 15 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,21 @@ var RootCmd = &cobra.Command{
Use: "atmos",
Short: "Universal Tool for DevOps and Cloud Automation",
Long: `Atmos is a universal tool for DevOps and cloud automation used for provisioning, managing and orchestrating workflows across various toolchains`,
PreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// Determine if the command is a help command or if the help flag is set
isHelpCommand := cmd.Name() == "help"
helpFlag := cmd.Flags().Changed("help")

isHelpRequested := isHelpCommand || helpFlag

if isHelpRequested {
// Do not silence usage or errors when help is invoked
cmd.SilenceUsage = false
cmd.SilenceErrors = false
} else {
cmd.SilenceUsage = true
cmd.SilenceErrors = true
}
},
Run: func(cmd *cobra.Command, args []string) {
// Check Atmos configuration
Expand Down
4 changes: 2 additions & 2 deletions examples/quick-start-advanced/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ ARG GEODESIC_OS=debian
# https://atmos.tools/
# https://github.com/cloudposse/atmos
# https://github.com/cloudposse/atmos/releases
ARG ATMOS_VERSION=1.89.0
ARG ATMOS_VERSION=1.93.0

# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.9.7
ARG TF_VERSION=1.9.8

FROM cloudposse/geodesic:${GEODESIC_VERSION}-${GEODESIC_OS}

Expand Down
2 changes: 1 addition & 1 deletion website/docs/integrations/atlantis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ on:
branches: [ main ]
env:
ATMOS_VERSION: 1.89.0
ATMOS_VERSION: 1.93.0
ATMOS_CLI_CONFIG_PATH: ./
jobs:
Expand Down

0 comments on commit c866ab5

Please sign in to comment.