diff options
| author | Jeff Carr <[email protected]> | 2024-11-07 13:30:17 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-07 13:30:17 -0600 |
| commit | 161f3934ceab7943445389daf199ad3901c091e8 (patch) | |
| tree | ffa77b7304ed745589506f6cb1d4d6baf0f331c4 /argv.go | |
| parent | bc01313a04ddb0cfe5eae72a0e04995765a53c84 (diff) | |
update to also embed toolkit plugins in the binaryv0.21.1
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -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 +} |
