diff options
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) } |
