From 3b9654c123d7cd6c9932a7c260ef041c26f7d4aa Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Mon, 22 Feb 2016 19:12:37 +0100 Subject: custom usage --- goboom.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/goboom.go b/goboom.go index 5e26fd1..361bbcf 100644 --- a/goboom.go +++ b/goboom.go @@ -227,6 +227,12 @@ func main() { flag.BoolVar(&postPhase, "post", false, "Update ranking DB") flag.BoolVar(&stats, "stats", false, "View DB stats") flag.BoolVar(&gc, "gc", false, "Run garbage collection of the DB") + flag.Usage = func() { + fmt.Printf("goboom v%s (%s/%s/%s)\n", version, runtime.GOOS, runtime.GOARCH, runtime.Version()) + fmt.Print("\nTo actually use goboom execute goboom_run\n\n") + fmt.Println("Options: ") + flag.PrintDefaults() + } flag.Parse() loadIni() @@ -250,8 +256,6 @@ func main() { } else if gc { fmt.Printf("Removed %d items\n", runGC()) } else { - fmt.Printf("goboom v%s (%s/%s/%s)\n", version, runtime.GOOS, runtime.GOARCH, runtime.Version()) - fmt.Println("\nTo actually use goboom execute goboom_run\n") flag.Usage() } } -- cgit v1.2.3