From 161f3934ceab7943445389daf199ad3901c091e8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 7 Nov 2024 13:30:17 -0600 Subject: update to also embed toolkit plugins in the binary Signed-off-by: Jeff Carr --- argv.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 argv.go (limited to 'argv.go') diff --git a/argv.go b/argv.go new file mode 100644 index 0000000..44b5b55 --- /dev/null +++ b/argv.go @@ -0,0 +1,38 @@ +package main + +import ( + "os" + + "github.com/alexflint/go-arg" +) + +/* + this parses the command line arguements + this enables command line options from other packages like 'gui' and 'log' +*/ + +var argv args + +type args struct { + Demo string `arg:"positional" help:"this is just a demo"` +} + +func (a args) Description() string { + return ` +This basicwindow example demonstrates multiple windows +` +} + +func init() { + pp := arg.MustParse(&argv) + + // for very new users or users unfamilar with the command line, this may help them + if argv.Demo == "version" || argv.Demo == "help" || argv.Demo == "?" { + pp.WriteHelp(os.Stdout) + os.Exit(0) + } +} + +func (args) Version() string { + return "basicwindow " + VERSION +} -- cgit v1.2.3