Skip to content

Commit

Permalink
Reorder workflow commands (#274)
Browse files Browse the repository at this point in the history
* Re-order workflow commands

* workflow list before describe
  • Loading branch information
feedmeapples committed Jul 7, 2023
1 parent 17fd0ad commit d37f65c
Showing 1 changed file with 68 additions and 68 deletions.
136 changes: 68 additions & 68 deletions workflow/workflow.go
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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)
},
},
{
Expand Down Expand Up @@ -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)
},
},
}
Expand Down

0 comments on commit d37f65c

Please sign in to comment.