@@ -44,6 +44,7 @@ import (
4444 "github.com/brevdev/brev-cli/pkg/cmd/tasks"
4545 "github.com/brevdev/brev-cli/pkg/cmd/test"
4646 "github.com/brevdev/brev-cli/pkg/cmd/updatemodel"
47+ "github.com/brevdev/brev-cli/pkg/cmd/version"
4748 "github.com/brevdev/brev-cli/pkg/cmd/workspacegroups"
4849 "github.com/brevdev/brev-cli/pkg/cmd/writeconnectionevent"
4950 "github.com/brevdev/brev-cli/pkg/config"
@@ -59,14 +60,16 @@ import (
5960)
6061
6162var (
62- userFlag string
63- printVersion bool
63+ userFlag string
64+ printVersion bool
65+ noCheckLatest bool
6466)
6567
6668func NewDefaultBrevCommand () * cobra.Command {
6769 cmd := NewBrevCommand ()
6870 cmd .PersistentFlags ().StringVar (& userFlag , "user" , "" , "non root user to use for per user configuration of commands run as root" )
6971 cmd .PersistentFlags ().BoolVar (& printVersion , "version" , false , "Print version output" )
72+ cmd .PersistentFlags ().BoolVar (& noCheckLatest , "no-check-latest" , false , "Do not check for the latest version when printing version" )
7073 return cmd
7174}
7275
@@ -187,6 +190,11 @@ func NewBrevCommand() *cobra.Command { //nolint:funlen,gocognit,gocyclo // defin
187190 },
188191 RunE : func (cmd * cobra.Command , args []string ) error {
189192 if printVersion {
193+ if noCheckLatest {
194+ // Only print the current version, no network call
195+ t .Vprint (fmt .Sprintf ("Current Version: %s" , version .Version ))
196+ return nil
197+ }
190198 v , err := remoteversion .BuildVersionString (t , noAuthCmdStore )
191199 if err != nil {
192200 t .Errprint (err , "Failed to determine version" )
0 commit comments