diff --git a/cmd/sst/main.go b/cmd/sst/main.go index cfab6d8bc..4c6f1c7ea 100644 --- a/cmd/sst/main.go +++ b/cmd/sst/main.go @@ -14,7 +14,6 @@ import ( "time" "github.com/nrednav/cuid2" - "github.com/pulumi/pulumi/sdk/v3" "github.com/briandowns/spinner" "github.com/fatih/color" @@ -1070,19 +1069,7 @@ var root = &cli.Command{ return nil }, }, - { - Name: "version", - Description: cli.Description{ - Short: "Print the version of the CLI", - Long: `Prints the current version of the CLI.`, - }, - Run: func(cli *cli.Cli) error { - fmt.Println("sst", version) - fmt.Println("pulumi", sdk.Version) - fmt.Println("config", global.ConfigDir()) - return nil - }, - }, + CmdVersion, { Name: "upgrade", Description: cli.Description{ diff --git a/cmd/sst/version.go b/cmd/sst/version.go new file mode 100644 index 000000000..9b6ac8b81 --- /dev/null +++ b/cmd/sst/version.go @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + + "github.com/pulumi/pulumi/sdk/v3" + "github.com/sst/ion/cmd/sst/cli" + "github.com/sst/ion/pkg/global" +) + +var CmdVersion = &cli.Command{ + Name: "version", + Description: cli.Description{ + Short: "Print the version of the CLI", + Long: `Prints the current version of the CLI.`, + }, + Run: func(cli *cli.Cli) error { + fmt.Println("sst", version) + if cli.Bool("verbose") { + fmt.Println("pulumi", sdk.Version) + fmt.Println("config", global.ConfigDir()) + } + return nil + }, +}