Added example program, New() now requires application name, fixed -h and -help.
This commit is contained in:
19
example/main.go
Normal file
19
example/main.go
Normal 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()
|
||||
}
|
Reference in New Issue
Block a user