-
Notifications
You must be signed in to change notification settings - Fork 51
/
flags.go
39 lines (33 loc) · 1.51 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
32
33
34
35
36
37
38
39
package main
import "flag"
type flags struct {
showGenerated bool
showNotGenerated bool
defJsonPath,
enumsJsonpath,
typedefsJsonpath,
refEnumsJsonPath,
refTypedefsJsonPath,
presetJsonPath,
refPackageName, // name for refTypedefs (default: imgui)
packageName, // name for current package (e.g. imgui, implot)
prefix,
include string
}
func parse() *flags {
flags := &flags{}
flag.BoolVar(&flags.showGenerated, "generated", false, "Log about functions that was generated.")
flag.BoolVar(&flags.showNotGenerated, "not-generated", true, "Log about functions that was NOT generated.")
flag.StringVar(&flags.defJsonPath, "d", "", "definitions json file path")
flag.StringVar(&flags.enumsJsonpath, "e", "", "structs and enums json file path")
flag.StringVar(&flags.typedefsJsonpath, "t", "", "typedefs dict json file path")
flag.StringVar(&flags.refEnumsJsonPath, "r", "", "reference structs and enums json file path")
flag.StringVar(&flags.refTypedefsJsonPath, "rt", "", "reference typedefs_dict.json file path")
flag.StringVar(&flags.presetJsonPath, "preset", "", "Preset of custom (manual) generator rules. See go doc github.com/AllenDang/cimgui-go/cmd/codegen.Preset for more details.")
flag.StringVar(&flags.refPackageName, "refPkg", "imgui", "name for refTypedefs package name")
flag.StringVar(&flags.packageName, "pkg", "", "name for current package")
flag.StringVar(&flags.prefix, "p", "", "prefix for the generated file")
flag.StringVar(&flags.include, "i", "", "include header file")
flag.Parse()
return flags
}