From 3c03b05a42ed5f882c0a3ce4437f4488e65e9e8c Mon Sep 17 00:00:00 2001 From: aknysh Date: Thu, 26 Dec 2024 23:21:24 -0500 Subject: [PATCH] updates --- internal/exec/help.go | 2 +- internal/exec/utils.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/exec/help.go b/internal/exec/help.go index b90c8ce64..4f0928c50 100644 --- a/internal/exec/help.go +++ b/internal/exec/help.go @@ -115,7 +115,7 @@ func processHelp( "If the workspace does not exist, the command creates it by executing the 'terraform workspace new' command.\n\n" + "Usage: atmos terraform workspace -s \n\n" + "For more details refer to https://atmos.tools/cli/commands/terraform/workspace\n") - } else { + } else if componentType == "terraform" || componentType == "helmfile" { u.PrintMessage(fmt.Sprintf("\nAtmos supports native '%s' commands with all the options, arguments and flags.\n", componentType)) u.PrintMessage("In addition, 'component' and 'stack' are required in order to generate variables for the component in the stack.\n") u.PrintMessage(fmt.Sprintf("atmos %s -s [options]", componentType)) diff --git a/internal/exec/utils.go b/internal/exec/utils.go index 3524103ca..cbc435906 100644 --- a/internal/exec/utils.go +++ b/internal/exec/utils.go @@ -162,7 +162,7 @@ func ProcessComponentConfig( return nil } -// processCommandLineArgs processes command-line args +// ProcessCommandLineArgs processes command-line args func ProcessCommandLineArgs( componentType string, cmd *cobra.Command, @@ -657,7 +657,10 @@ func ProcessStacks( } // processArgsAndFlags processes args and flags from the provided CLI arguments/flags -func processArgsAndFlags(componentType string, inputArgsAndFlags []string) (schema.ArgsAndFlagsInfo, error) { +func processArgsAndFlags( + componentType string, + inputArgsAndFlags []string, +) (schema.ArgsAndFlagsInfo, error) { var info schema.ArgsAndFlagsInfo var additionalArgsAndFlags []string var globalOptions []string @@ -669,6 +672,7 @@ func processArgsAndFlags(componentType string, inputArgsAndFlags []string) (sche info.NeedHelp = true return info, nil } + if len(inputArgsAndFlags) == 1 && inputArgsAndFlags[0] == "version" { info.SubCommand = inputArgsAndFlags[0] return info, nil