Skip to content

Commit

Permalink
Add tctl next deprecation message (#342)
Browse files Browse the repository at this point in the history
* Add tctl next deprecation message

* Update cli/app.go

Co-authored-by: Roey Berman <roey.berman@gmail.com>

---------

Co-authored-by: Roey Berman <roey.berman@gmail.com>
  • Loading branch information
feedmeapples and bergundy authored Feb 4, 2023
1 parent ca2e65f commit 163aaf8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"program": "${workspaceFolder}/cmd/tctl",
"cwd": "${workspaceFolder}",
"args": [
"config",
"get",
"version",
"workflow",
"list",
"-h",
]
},
{
Expand Down
16 changes: 13 additions & 3 deletions cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 163aaf8

Please sign in to comment.