From d37f65cec42f708370ec06d3cf92088ce71eb827 Mon Sep 17 00:00:00 2001 From: Ruslan <11838981+feedmeapples@users.noreply.github.com> Date: Thu, 6 Jul 2023 19:02:01 -0700 Subject: [PATCH] Reorder workflow commands (#274) * Re-order workflow commands * workflow list before describe --- workflow/workflow.go | 136 +++++++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/workflow/workflow.go b/workflow/workflow.go index 7e4dd41d..8f023e05 100644 --- a/workflow/workflow.go +++ b/workflow/workflow.go @@ -28,6 +28,15 @@ func NewWorkflowCommands() []*cli.Command { return StartWorkflow(c, true) }, }, + { + Name: "list", + Usage: common.ListWorkflowDefinition, + UsageText: common.ListWorkflowUsageText, + Flags: append(common.FlagsForWorkflowFiltering, common.FlagsForPaginationAndRendering...), + Action: func(c *cli.Context) error { + return ListWorkflow(c) + }, + }, { Name: "describe", Usage: common.DescribeWorkflowDefinition, @@ -48,15 +57,6 @@ func NewWorkflowCommands() []*cli.Command { return DescribeWorkflow(c) }, }, - { - Name: "list", - Usage: common.ListWorkflowDefinition, - UsageText: common.ListWorkflowUsageText, - Flags: append(common.FlagsForWorkflowFiltering, common.FlagsForPaginationAndRendering...), - Action: func(c *cli.Context) error { - return ListWorkflow(c) - }, - }, { Name: "show", Usage: common.ShowWorkflowDefinition, @@ -66,6 +66,36 @@ func NewWorkflowCommands() []*cli.Command { return ShowHistory(c) }, }, + { + Name: "trace", + Usage: common.TraceWorkflowDefinition, + UsageText: common.WorkflowTraceUsageText, + Flags: append(common.FlagsForExecution, + &cli.IntFlag{ + Name: common.FlagDepth, + Value: -1, + Usage: common.FlagDepthDefinition, + Category: common.CategoryMain, + }, + &cli.IntFlag{ + Name: common.FlagConcurrency, + Value: 10, + Usage: common.FlagConcurrencyDefinition, + Category: common.CategoryMain, + }, + &cli.StringFlag{ + Name: common.FlagFold, + Usage: fmt.Sprintf("Statuses for which Child Workflows will be folded in (this will reduce the number of information fetched and displayed). Case-insensitive and ignored if --%s supplied.", common.FlagNoFold), + Value: "completed,canceled,terminated", + Category: common.CategoryMain, + }, + &cli.BoolFlag{ + Name: common.FlagNoFold, + Usage: common.FlagNoFoldDefinition, + Category: common.CategoryMain, + }), + Action: TraceWorkflow, + }, { Name: "query", Usage: common.QueryWorkflowDefinition, @@ -148,19 +178,30 @@ func NewWorkflowCommands() []*cli.Command { }, }, { - Name: "count", - Usage: common.CountWorkflowDefinition, - UsageText: common.WorkflowCountUsageText, - Flags: []cli.Flag{ + Name: "update", + Usage: common.UpdateWorkflowDefinition, + UsageText: common.WorkflowUpdateUsageText, + Flags: append(common.FlagsForExecution, &cli.StringFlag{ - Name: common.FlagQuery, - Aliases: common.FlagQueryAlias, - Usage: common.FlagQueryUsage, + Name: common.FlagName, + Usage: common.FlagUpdateHandlerName, Category: common.CategoryMain, + Required: true, }, - }, + &cli.StringFlag{ + Name: common.FlagInput, + Aliases: common.FlagInputAlias, + Usage: common.FlagUpdateHandlerInput, + Category: common.CategoryMain, + }, + &cli.StringFlag{ + Name: common.FlagUpdateFirstExecutionRunID, + Usage: "Run update on the last execution in the chain that started with this run ID.", + Category: common.CategoryMain, + }, + ), Action: func(c *cli.Context) error { - return CountWorkflow(c) + return UpdateWorkflow(c) }, }, { @@ -386,60 +427,19 @@ func NewWorkflowCommands() []*cli.Command { }, }, { - Name: "trace", - Usage: common.TraceWorkflowDefinition, - UsageText: common.WorkflowTraceUsageText, - Flags: append(common.FlagsForExecution, - &cli.IntFlag{ - Name: common.FlagDepth, - Value: -1, - Usage: common.FlagDepthDefinition, - Category: common.CategoryMain, - }, - &cli.IntFlag{ - Name: common.FlagConcurrency, - Value: 10, - Usage: common.FlagConcurrencyDefinition, - Category: common.CategoryMain, - }, - &cli.StringFlag{ - Name: common.FlagFold, - Usage: fmt.Sprintf("Statuses for which Child Workflows will be folded in (this will reduce the number of information fetched and displayed). Case-insensitive and ignored if --%s supplied.", common.FlagNoFold), - Value: "completed,canceled,terminated", - Category: common.CategoryMain, - }, - &cli.BoolFlag{ - Name: common.FlagNoFold, - Usage: common.FlagNoFoldDefinition, - Category: common.CategoryMain, - }), - Action: TraceWorkflow, - }, - { - Name: "update", - Usage: common.UpdateWorkflowDefinition, - UsageText: common.WorkflowUpdateUsageText, - Flags: append(common.FlagsForExecution, - &cli.StringFlag{ - Name: common.FlagName, - Usage: common.FlagUpdateHandlerName, - Category: common.CategoryMain, - Required: true, - }, - &cli.StringFlag{ - Name: common.FlagInput, - Aliases: common.FlagInputAlias, - Usage: common.FlagUpdateHandlerInput, - Category: common.CategoryMain, - }, + Name: "count", + Usage: common.CountWorkflowDefinition, + UsageText: common.WorkflowCountUsageText, + Flags: []cli.Flag{ &cli.StringFlag{ - Name: common.FlagUpdateFirstExecutionRunID, - Usage: "Run update on the last execution in the chain that started with this run ID.", + Name: common.FlagQuery, + Aliases: common.FlagQueryAlias, + Usage: common.FlagQueryUsage, Category: common.CategoryMain, }, - ), + }, Action: func(c *cli.Context) error { - return UpdateWorkflow(c) + return CountWorkflow(c) }, }, }