summaryrefslogtreecommitdiff
path: root/argv.template.go
diff options
context:
space:
mode:
Diffstat (limited to 'argv.template.go')
-rw-r--r--argv.template.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/argv.template.go b/argv.template.go
index 5ca2ff7..a4dd38a 100644
--- a/argv.template.go
+++ b/argv.template.go
@@ -10,11 +10,9 @@ import (
"go.wit.com/dev/alexflint/arg"
"go.wit.com/gui"
+ "go.wit.com/lib/fhelp"
)
-// this must be global until further development and abstraction
-var argvpp *arg.Parser // the go-arg parser of the command line
-
func (args) InitArgv() (string, string, string) {
return APPNAME, BUILDTIME, VERSION
}
@@ -22,25 +20,26 @@ func (args) InitArgv() (string, string, string) {
// this function will send the current argv PB to go-args for parsing
func (args) ParseFlags(flags []string) error {
var err error
- if argvpp == nil {
+ if me.pp == nil {
// log.Info("Parse Flags GOT flags:", flags)
- argvpp, err = arg.ParseFlags(flags, &argv)
+ me.pp, err = arg.ParseFlags(flags, &argv)
// panic("got to the app's ParseFlags()")
} else {
- panic("argvpp was not nil")
+ panic("me.pp was not nil")
}
return err
}
// this will print the help for the subcmd
func (args) WriteHelpForAutocomplete(part string, subcmd ...string) error {
- return argvpp.WriteHelpForAutocomplete(os.Stderr, os.Stdout, part, subcmd...)
+ return me.pp.WriteHelpForAutocomplete(os.Stderr, os.Stdout, part, subcmd...)
}
func (args) InitGui() error {
// panic("got here")
arg.Register(&gui.ArgvGui)
- // me.myGui = gui.New()
+ // me.gui = gui.PreInit()
+ me.myGui = fhelp.Gui()
return nil
}
@@ -49,7 +48,7 @@ func (args) Help() string {
}
func (args) MustParse() error {
- argvpp = arg.MustParse(&argv)
+ me.pp = arg.MustParse(&argv)
return nil
}