Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Added version flag (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddy-codes authored and ammario committed May 23, 2019
1 parent 9d35204 commit a01aa56
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (r rootCmd) Subcommands() []cli.Command {
&rmcmd{gf: &r.globalFlags},
&proxycmd{},
&chromeExtInstall{},
&versioncmd{},
}
}

Expand Down
23 changes: 23 additions & 0 deletions versionmd.go
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit a01aa56

Please sign in to comment.