Register() will be used to load the config & create on first run.
--- 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 <roberto@keltia.net>"
- app.Version = gondole.Version
+ app.Version = gondole.APIVersion
//app.HideVersion = true
+ app.Before = Register
+
app.Flags = []cli.Flag{
cli.BoolFlag{
Name: "verbose,v",