Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aknysh committed Dec 27, 2024
1 parent 1f92bc7 commit 3c03b05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/exec/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <component> -s <stack>\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 <subcommand> <component> -s <stack> [options]", componentType))
Expand Down
8 changes: 6 additions & 2 deletions internal/exec/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3c03b05

Please sign in to comment.