Skip to content

Instantly share code, notes, and snippets.

@tucnak
Created November 11, 2015 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tucnak/6ac7fd3dce564b21a8fb to your computer and use it in GitHub Desktop.
Save tucnak/6ac7fd3dce564b21a8fb to your computer and use it in GitHub Desktop.
package main
import (
"github.com/tucnak/climax"
)
func plain(group, name, brief string) *climax.Command {
return &climax.Command{
Name: name,
Brief: brief,
Group: group,
}
}
func main() {
demo := climax.New("demo")
demo.Brief = "Demo is a funky demonstation of Climax capabilities."
demo.Version = "stable"
const (
doCategory = "Actions"
viewCategory = "Observers"
miscCategory = "Misc"
)
actionsGroup := demo.AddGroup("Actions")
observersGroup := demo.AddGroup("Observers")
miscGroup := demo.AddGroup("Misc")
demo.AddCommand(*plain(actionsGroup, "perform", "lorem ipsum dolor"))
demo.AddCommand(*plain(actionsGroup, "another", "some other action"))
demo.AddCommand(*plain(actionsGroup, "google", "meh, whatever"))
demo.AddCommand(*plain(observersGroup, "watchers", "liek some watchers"))
demo.AddCommand(*plain(observersGroup, "monitors", "these are different"))
demo.AddCommand(*plain(observersGroup, "fancitors", "meh, whatever"))
demo.AddCommand(*plain(miscGroup, "help", "find out more"))
demo.AddCommand(*plain(miscGroup, "version", "current build info"))
demo.AddCommand(*plain(miscGroup, "authors", "we are legion"))
demo.Run()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment