Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored and samtholiya committed Feb 5, 2025
1 parent c0ab2d4 commit 316fc49
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/cmd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ func showUsageExample(cmd *cobra.Command, details string) {
suggestion = exampleContent.Suggestion
details += "\n## Usage Examples:\n" + exampleContent.Content
}
u.PrintInvalidUsageErrorAndExit(errors.New(details))
u.PrintInvalidUsageErrorAndExit(errors.New(details), suggestion)
}

// Contains checks if a slice of strings contains an exact match for the target string.
Expand Down
2 changes: 1 addition & 1 deletion cmd/list_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var listComponentsCmd = &cobra.Command{

stackFlag, err := flags.GetString("stack")
if err != nil {
u.PrintInvalidUsageErrorAndExit(fmt.Errorf("Error getting the `stack` flag: `%v`", err))
u.PrintInvalidUsageErrorAndExit(fmt.Errorf("Error getting the `stack` flag: `%v`", err), "")
return
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/list_workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ var listWorkflowsCmd = &cobra.Command{

fileFlag, err := flags.GetString("file")
if err != nil {
u.PrintInvalidUsageErrorAndExit(fmt.Errorf("Error getting the `file` flag: %v", err))
u.PrintInvalidUsageErrorAndExit(fmt.Errorf("Error getting the `file` flag: %v", err), "")
return
}

formatFlag, err := flags.GetString("format")
if err != nil {
u.PrintInvalidUsageErrorAndExit(fmt.Errorf("Error getting the `format` flag: %v", err))
u.PrintInvalidUsageErrorAndExit(fmt.Errorf("Error getting the `format` flag: %v", err), "")
return
}

delimiterFlag, err := flags.GetString("delimiter")
if err != nil {
u.PrintInvalidUsageErrorAndExit(fmt.Errorf("Error getting the `delimiter` flag: %v", err))
u.PrintInvalidUsageErrorAndExit(fmt.Errorf("Error getting the `delimiter` flag: %v", err), "")
return
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/utils/markdown_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func PrintErrorMarkdownAndExit(title string, err error, suggestion string) {
os.Exit(1)
}

func PrintInvalidUsageErrorAndExit(err error) {
func PrintInvalidUsageErrorAndExit(err error, suggestion string) {
PrintErrorMarkdownAndExit("Invalid Usage", err, "")
}

Expand Down

0 comments on commit 316fc49

Please sign in to comment.