diff options
| author | Jeff Carr <[email protected]> | 2025-09-25 01:40:54 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-25 01:40:54 -0500 |
| commit | 5f2f877001dfa6d26f3a2ec30ff4852db124a7e3 (patch) | |
| tree | 175884ed8fca775f093089f0fbba31b4a26aa01f | |
| parent | dcac6d6608dc2106fe6217d3279e0052591454bc (diff) | |
new autocomplete methodv0.23.121
| -rw-r--r-- | argv.go | 41 | ||||
| -rw-r--r-- | main.go | 6 | ||||
| -rw-r--r-- | structs.go | 3 |
3 files changed, 14 insertions, 36 deletions
@@ -1,9 +1,9 @@ package main import ( - "fmt" "os" - "os/user" + + "go.wit.com/lib/gui/prep" ) /* @@ -52,34 +52,15 @@ func (args) Version() string { handles shell autocomplete */ -func (a args) DoAutoComplete(argv []string) { - switch argv[0] { - case "checkout": - usr, _ := user.Current() - fmt.Println("user devel master " + usr.Username) - case "commit": - fmt.Println("--all") - case "config": - fmt.Println("add fix list delete") - case "list": - fmt.Println("--all --mine --favorites --private") - case "pull": - fmt.Println("--all --mine --favorites --private") - case "patch": - fmt.Println("--list --submit --show") - case "dirty": - fmt.Println("--show-files") - case "user": - fmt.Println("--force") - case "devel": - fmt.Println("--force") - case "master": - fmt.Println("--force") - default: - if argv[0] == ARGNAME { - // list the subcommands here - fmt.Println("--bash quick") - } +func (args) Appname() string { + return ARGNAME +} + +func (a args) DoAutoComplete(pb *prep.Auto) { + if pb.Cmd == "" { + pb.Autocomplete3([]string{"--bash", "quick"}) + } else { + pb.SubCommand(pb.Argv...) } os.Exit(0) } @@ -7,7 +7,6 @@ import ( "os" "path/filepath" - "go.wit.com/dev/alexflint/arg" "go.wit.com/lib/fhelp" "go.wit.com/lib/gadgets" "go.wit.com/lib/gui/prep" @@ -27,9 +26,8 @@ var argv args func main() { me = new(autoType) - 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) + me.myGui = prep.Gui() // prepares the GUI package for go-args + me.auto = prep.Bash3(&argv) // this line should be: prep.Bash(&argv) me.forge = forgepb.Init() me.forge.ScanRepoDir() // looks for new dirs, checks existing repos for changes @@ -2,7 +2,6 @@ package main import ( - "go.wit.com/dev/alexflint/arg" "go.wit.com/gui" "go.wit.com/lib/gadgets" "go.wit.com/lib/gui/prep" @@ -13,7 +12,7 @@ import ( var me *autoType type autoType struct { - pp *arg.Parser // for parsing the command line args. Yay to alexf lint! + auto *prep.Auto // more experiments for bash handling myGui *prep.GuiPrep // the gui handle itself releaseReasonS string // = "gocui dropdown select" release releaseStruct // notsure |
