diff --git a/.vscode/launch.json b/.vscode/launch.json index ea578df..d5e39b3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,9 +10,9 @@ "program": "${workspaceFolder}/cmd/tctl", "cwd": "${workspaceFolder}", "args": [ - "config", - "get", - "version", + "workflow", + "list", + "-h", ] }, { diff --git a/cli/app.go b/cli/app.go index b927ceb..61dbadc 100644 --- a/cli/app.go +++ b/cli/app.go @@ -29,14 +29,13 @@ import ( "os" "runtime/debug" - "github.com/urfave/cli/v2" - + fcolor "github.com/fatih/color" "github.com/temporalio/tctl-kit/pkg/color" - "github.com/temporalio/tctl/cli/dataconverter" "github.com/temporalio/tctl/cli/headersprovider" "github.com/temporalio/tctl/cli/plugin" "github.com/temporalio/tctl/config" + "github.com/urfave/cli/v2" ) // SetFactory is used to set the ClientFactory global @@ -141,6 +140,17 @@ func NewCliApp() *cli.App { app.After = stopPlugins app.ExitErrHandler = handleError + tctlNextDeprecation := fcolor.YellowString("WARNING: tctl next is going to be deprecated. Please upgrade to Temporal CLI https://github.com/temporalio/cli#getting-started\n") + app.CustomAppHelpTemplate = cli.AppHelpTemplate + "\n" + tctlNextDeprecation + + for _, cmd := range app.Commands { + cmd.CustomHelpTemplate = cli.CommandHelpTemplate + tctlNextDeprecation + + for _, subcmd := range cmd.Subcommands { + subcmd.CustomHelpTemplate = cli.CommandHelpTemplate + tctlNextDeprecation + } + } + // set builder if not customized if cFactory == nil { SetFactory(NewClientFactory())