-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathflags.go
31 lines (23 loc) · 1.59 KB
/
flags.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import "github.com/cosiner/flag"
type flags struct {
ShowGenerated bool `names:"-lg, --log-generated" usage:"Log about functions that was generated." default:"false"`
ShowNotGenerated bool `names:"-lng, --log-not-generated" usage:"Log about functions that was NOT generated." default:"false"`
Verbose bool `names:"--verbose" usage:"Verbose output (dump literally everything it could dump)." default:"false`
DefJsonPath string `names:"-d, --definitions" usage:"definitions.json file path"`
EnumsJsonpath string `names:"-e, --enums" usage:"structs_and_enums.json file path"`
TypedefsJsonpath string `names:"-t, --typedefs" usage:"typedefs_dict.json file path"`
RefEnumsJsonPath string `names:"-re, --ref-enums" usage:"structs_and_enums.json file path for reference package (see README.md)."`
RefTypedefsJsonPath string `names:"-rt, --ref-typedefs" usage:"typedefs_dict.json file path for reference package (see README.md)."`
PresetJsonPath string `names:"-p, --preset" usage:"Preset of custom (manual) generator rules. See go doc github.com/AllenDang/cimgui-go/cmd/codegen.Preset for more details. (in form of json file)"`
// name for refTypedefs (default: imgui)
RefPackageName string `names:"-rp, --ref-pkg" usage:"name for refTypedefs package name" default:"imgui"`
// name for current package (e.g. imgui, implot)
PackageName string `names:"-pkg, --package" usage:"name for current package"`
Include string `names:"-i, --include" usage:"Include header file (source project's header)"`
}
func parse() *flags {
flags := &flags{}
flag.ParseStruct(flags)
return flags
}