Added example program, New() now requires application name, fixed -h and -help.

This commit is contained in:
2018-12-18 04:02:01 +05:00
parent d02921ea77
commit ba5b52918e
3 changed files with 26 additions and 5 deletions

19
example/main.go Normal file
View File

@@ -0,0 +1,19 @@
package main
import (
"gitlab.com/pztrn/flagger"
)
var f *flagger.Flagger
func main() {
f = flagger.New("testprogram", nil)
f.Initialize()
f.AddFlag(&flagger.Flag{
Name: "testflag",
Description: "Just a test flag",
Type: "bool",
DefaultValue: false,
})
f.Parse()
}