summaryrefslogtreecommitdiff
path: root/argv.template.go
diff options
context:
space:
mode:
Diffstat (limited to 'argv.template.go')
-rw-r--r--argv.template.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/argv.template.go b/argv.template.go
index 681be3b..801f9e6 100644
--- a/argv.template.go
+++ b/argv.template.go
@@ -6,8 +6,6 @@ package main
// TODO: clean this up in argv
import (
- "os"
-
"go.wit.com/dev/alexflint/arg"
"go.wit.com/gui"
"go.wit.com/lib/env"
@@ -20,11 +18,11 @@ 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 {
+func (args) ParseFlags() error {
var err error
if me.pp == nil {
// log.Info("Parse Flags GOT flags:", flags)
- me.pp, err = arg.ParseFlags(flags, &argv)
+ me.pp, err = arg.ParseFlagsArgv(&argv)
// panic("got to the app's ParseFlags()")
} else {
panic("me.pp was not nil")
@@ -33,24 +31,23 @@ func (args) ParseFlags(flags []string) error {
}
// add this funcgion: this will print the help
-func (args) WriteHelpForSubcommand(cmd string) error {
- me.pp.WriteHelpForSubcommand(os.Stderr, cmd)
+func (args) WriteHelpForSubcommand() error {
+ me.pp.WriteHelpForSubcommandArgv()
return nil
}
// this will print the help for the subcmd
-func (args) WriteHelpForAutocomplete(part string, subcmd ...string) error {
- return me.pp.WriteHelpForAutocomplete(os.Stderr, os.Stdout, part, subcmd...)
+func (args) WriteHelpForAutocomplete() error {
+ return me.pp.WriteHelpForAutocompleteArgv()
}
-func (args) WriteHelpForAutocompleteDebug(part string, subcmd ...string) error {
- f, _ := os.OpenFile("/tmp/argv.junk", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
- return me.pp.WriteHelpForAutocomplete(f, os.Stdout, part, subcmd...)
+func (args) WriteHelpForAutocompleteDebug() error {
+ return me.pp.WriteHelpForAutocompleteArgv()
}
// add this funcgion: this will print the help
func (args) WriteHelp() error {
- me.pp.WriteHelp(os.Stderr)
+ me.pp.WriteHelpArgv()
return nil
}