diff options
| author | Jeff Carr <[email protected]> | 2023-12-20 18:36:58 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-21 09:16:35 -0600 |
| commit | 1b32ded4dc53175a975f330cdc11fc5dcb09680a (patch) | |
| tree | d15ecbdbce06c6dd3e5280fd3cfb86aebedfd4fe /examples/cloudflare/argv.go | |
| parent | 379fee6d963fe33b798676fd96955ad1c51a3027 (diff) | |
add the cloudflare example app
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'examples/cloudflare/argv.go')
| -rw-r--r-- | examples/cloudflare/argv.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/cloudflare/argv.go b/examples/cloudflare/argv.go new file mode 100644 index 0000000..49167cd --- /dev/null +++ b/examples/cloudflare/argv.go @@ -0,0 +1,30 @@ +// This creates a simple hello world window +package main + +import ( + "fmt" + arg "github.com/alexflint/go-arg" + "go.wit.com/gui" + log "go.wit.com/gui/log" +) + + +var args struct { + Foo string + Bar bool + User string `arg:"env:USER"` + Demo bool `help:"run a demo"` + gui.GuiArgs + log.LogArgs +} + +func init() { + arg.MustParse(&args) + fmt.Println(args.Foo, args.Bar, args.User) + + if (args.Gui != "") { + gui.GuiArg.Gui = args.Gui + } + log.Log(true, "INIT() args.GuiArg.Gui =", gui.GuiArg.Gui) + +} |
