Created
November 11, 2015 17:51
-
-
Save tucnak/6ac7fd3dce564b21a8fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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