Skip to content

Commit

Permalink
add version command
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jul 5, 2017
1 parent 1e3667d commit 00e24ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/polls/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ func main() {
app.Version(version)

create := app.Command("new", "Create a new poll.")
options := create.Arg("options", "Poll options.").Required().Strings()
create.Example(`polls new Tobi Loki Jane`, "Create a new poll for who is the best ferret.")
create.Example(`polls new "Cats are better" "Ferrets are better"`, "Create a new poll with larger options.")
options := create.Arg("options", "Poll options.").Required().Strings()

versionCommand := app.Command("version", "Output program version.")
versionCommand.Example(`polls version`, "Show the version :).")

switch kingpin.MustParse(app.Parse(os.Args[1:])) {
case versionCommand.FullCommand():
fmt.Println(version)
case create.FullCommand():
polls := client.Client{
Endpoint: endpoint,
Expand Down

0 comments on commit 00e24ae

Please # to comment.