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 /argv.go | |
| parent | dcac6d6608dc2106fe6217d3279e0052591454bc (diff) | |
new autocomplete methodv0.23.121
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 41 |
1 files changed, 11 insertions, 30 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) } |
