diff --git a/main.go b/main.go index d859bea..0423173 100644 --- a/main.go +++ b/main.go @@ -66,6 +66,7 @@ func (r rootCmd) Subcommands() []cli.Command { &rmcmd{gf: &r.globalFlags}, &proxycmd{}, &chromeExtInstall{}, + &versioncmd{}, } } diff --git a/versionmd.go b/versionmd.go new file mode 100644 index 0000000..bcc71a2 --- /dev/null +++ b/versionmd.go @@ -0,0 +1,23 @@ +package main + +import ( + "flag" + "fmt" + + "go.coder.com/cli" +) + +var version string + +type versioncmd struct {} + +func (v *versioncmd) Spec() cli.CommandSpec { + return cli.CommandSpec{ + Name: "version", + Desc: fmt.Sprintf("Retrieve the current version."), + } +} + +func (v *versioncmd) Run(fl *flag.FlagSet) { + fmt.Println(version) +}