github.com/posener/complete (go): Package complete provides a tool for bash writing bash completion in go, and bash completion for the go command line.  Writing bash completion scripts is a hard work. This package provides an easy way to create bash completion scripts for any command, and also an easy way to install/uninstall the completion of the command.  In ./cmd/gocomplete there is an example for bash completion for the `go` command line.  This is an example that uses the `complete` package on the `go` command - the `complete` package can also be used to implement any completions, see #usage.  1. Type in your shell:  2. Restart your shell  Uninstall by `gocomplete -uninstall`  - Complete `go` command, including sub commands and all flags. - Complete packages names or `.go` files when necessary. - Complete test names after `-run` flag.  Supported shells:  - [x] bash - [x] zsh - [x] fish  Assuming you have program called `run` and you want to have bash completion for it, meaning, if you type `run` then space, then press the `Tab` key, the shell will suggest relevant complete options.  In that case, we will create a program called `runcomplete`, a go program, with a `func main()` and so, that will make the completion of the `run` program. Once the `runcomplete` will be in a binary form, we could `runcomplete -install` and that will add to our shell all the bash completion options for `run`.  So here it is:  In case that the program that we want to complete is written in go we can make it self completing. Here is an example: ./example/self/main.go .
Keywords: bash-completion|completion|fish-completion|go|golang|shell|zsh-completion