diff options
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -1,5 +1,11 @@ package main +import ( + "fmt" + "os" + "os/user" +) + /* this parses the command line arguements @@ -41,3 +47,39 @@ the repositories in the go.sum file using git clone` func (args) Version() string { return "guireleaser " + VERSION } + +/* + 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") + } + } + os.Exit(0) +} |
