From a991a4c187ca0462f713d6b474a9bb8400ac3820 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 9 Sep 2025 02:04:35 -0500 Subject: argv autocomplete is fun! --- main.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 2b33665..c1b8697 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( "go.wit.com/dev/alexflint/arg" "go.wit.com/gui" - "go.wit.com/lib/fhelp" + "go.wit.com/lib/gui/prep" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" @@ -47,17 +47,20 @@ func getVersion(repo *gitpb.Repo, name string) string { func main() { me = new(mainType) - gui.InitArg() + prep.Bash(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(argv) + me.myGui = prep.Gui() // prepares the GUI package for go-args me.pp = arg.MustParse(&argv) - if argv.Bash { - fhelp.DoBash(ARGNAME) - os.Exit(0) - } - if len(argv.BashAuto) != 0 { - argv.doBashAuto() - os.Exit(0) - } + /* + if argv.Bash { + fhelp.DoBash(ARGNAME) + os.Exit(0) + } + if len(argv.BashAuto) != 0 { + argv.doBashAuto() + os.Exit(0) + } + */ me.urlbase = argv.URL if me.urlbase == "" { me.urlbase = "https://go.wit.com/" @@ -185,7 +188,6 @@ func main() { okExit("") } - // if you are in "normal" mode, always run normal every time to catch accidental errors // for example, if you accidentally changed branches from your user branch if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL { @@ -194,7 +196,6 @@ func main() { } } - if argv.Merge != nil { if argv.Merge.Devel != nil { start := time.Now() @@ -243,7 +244,6 @@ func main() { okExit("") } - // if the user doesn't want to open the GUI and // nothing else was specified to be done, // then just list the table to stdout -- cgit v1.2.3