diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -17,18 +17,17 @@ var resources embed.FS func main() { me = new(mainType) - // autocomplete must be processed before there is anything sent to STDOUT or STDERR - me.argv = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args - me.homedir, _ = os.UserHomeDir() // store shortcut here todo: add better logic + argvpb.Init(&argv, APPNAME, BUILDTIME, VERSION) // adds shell auto-complete + me.homedir, _ = os.UserHomeDir() // store shortcut here todo: add better logic - if me.argv.GetCmd() == "" { + if argvpb.GetCmd() == "" { // user didn't enter a sub command // doDefaultBehavior() - me.argv.GoodExit("do what?") + argvpb.GoodExit("do what?") } pwd, _ := os.Getwd() - setTitle(log.Sprintf("wit %s %s", me.argv.GetCmd(), pwd)) + setTitle(log.Sprintf("wit %s %s", argvpb.GetCmd(), pwd)) // Standard subcommand handling starts here var s string @@ -40,10 +39,10 @@ func main() { // argv provides timing and other features on exit if err != nil { // bad exit back to the shell via argv - me.argv.BadExit(s, err) + argvpb.BadExit(s, err) } // a good exit back to the shell via argv - me.argv.GoodExit(s) + argvpb.GoodExit(s) } // this is dumb. sync this with go-deb |
