# HG changeset patch # User Ollivier Robert # Date 1491514521 -7200 # Node ID a01761bc58378991cb070b7e18b49b2c4461f035 # Parent 512f1bfaed0c53fa25a60f76bb656bd89560aaae Register() will be used to load the config & create on first run. diff -r 512f1bfaed0c -r a01761bc5837 cmd/gondole/main.go --- a/cmd/gondole/main.go Thu Apr 06 23:33:54 2017 +0200 +++ b/cmd/gondole/main.go Thu Apr 06 23:35:21 2017 +0200 @@ -14,20 +14,29 @@ func init() { } -func main() { +func Register(c *cli.Context) error { + + return nil +} + +func init() { cli.VersionFlag = cli.BoolFlag{Name: "version, V"} cli.VersionPrinter = func(c *cli.Context) { - log.Printf("API wrapper: %s Mastodon CLI: %s\n", c.App.Version, gondole.Version) + log.Printf("API wrapper: %s Mastodon CLI: %s\n", c.App.Version, gondole.APIVersion) } +} +func main() { app := cli.NewApp() app.Name = "gondole" app.Usage = "Mastodon CLI interface" app.Author = "Ollivier Robert " - app.Version = gondole.Version + app.Version = gondole.APIVersion //app.HideVersion = true + app.Before = Register + app.Flags = []cli.Flag{ cli.BoolFlag{ Name: "verbose,v",