Skip to content

Commit 48e304e

Browse files
committed
post merge + lint
1 parent b88384a commit 48e304e

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

cmd/src/abc_variables_delete.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
)
1414

1515
var abcVariablesDeleteCommand = clicompat.Wrap(&cli.Command{
16-
Name: "delete",
17-
Usage: "Delete variables on a workflow instance",
18-
UsageText: "src abc variables delete [options] <workflow-instance-id> [<name> ...]",
16+
Name: "delete",
17+
Usage: "Delete variables on a workflow instance",
18+
UsageText: "src abc variables delete [options] <workflow-instance-id> [<name> ...]",
1919
DisableSliceFlagSeparator: true,
2020
Description: `
2121
Delete workflow instance variables

cmd/src/abc_variables_set.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ const updateABCWorkflowInstanceVariablesMutation = `mutation UpdateAgenticWorkfl
2525
}`
2626

2727
var abcVariablesSetCommand = clicompat.Wrap(&cli.Command{
28-
Name: "set",
29-
UsageText: "src abc variables set [options] <workflow-instance-id> [<name>=<value> ...]",
30-
Usage: "Set variables on a workflow instance",
28+
Name: "set",
29+
UsageText: "src abc variables set [options] <workflow-instance-id> [<name>=<value> ...]",
30+
Usage: "Set variables on a workflow instance",
3131
DisableSliceFlagSeparator: true,
3232
Description: `
3333
Set workflow instance variables

internal/clicompat/help.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,23 @@ func Wrap(cmd *cli.Command) *cli.Command {
1414
if cmd == nil {
1515
return nil
1616
}
17-
17+
1818
cmd.OnUsageError = OnUsageError
19-
cmd.Action = wrapUsageAction(cmd.Action)
19+
cmd.Action = wrapWithHelpOnUsageError(cmd.Action)
2020
return cmd
2121
}
2222

23-
func wrapUsageAction(action cli.ActionFunc) cli.ActionFunc {
23+
func wrapWithHelpOnUsageError(action cli.ActionFunc) cli.ActionFunc {
2424
if action == nil {
2525
return nil
2626
}
2727

2828
return func(ctx context.Context, cmd *cli.Command) error {
2929
err := action(ctx, cmd)
30-
if err == nil || !errors.HasType[*cmderrors.UsageError](err) {
31-
return err
30+
if err != nil && errors.HasType[*cmderrors.UsageError](err) {
31+
_, _ = fmt.Fprintf(cmd.Root().ErrWriter, "error: %s\n", err)
32+
cli.DefaultPrintHelp(cmd.Root().ErrWriter, cmd.CustomHelpTemplate, cmd)
3233
}
33-
34-
_, _ = fmt.Fprintf(cmd.Root().ErrWriter, "error: %s\n", err)
35-
cli.DefaultPrintHelp(cmd.Root().ErrWriter, cmd.CustomHelpTemplate, cmd)
3634
return err
3735
}
3836
}

0 commit comments

Comments
 (0)