Top 0.1% dependent packages on proxy.golang.org
Top 0.1% dependent repos on proxy.golang.org
Top 3.1% forks on proxy.golang.org
Top 0.1% docker downloads on proxy.golang.org
proxy.golang.org : github.com/posener/complete
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 .
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/posener/complete
Keywords:
bash-completion
, completion
, fish-completion
, go
, golang
, shell
, zsh-completion
License: MIT
Latest release: over 5 years ago
First release: about 7 years ago
Namespace: github.com/posener
Dependent packages: 6,382
Dependent repositories: 73,252
Stars: 878 on GitHub
Forks: 68 on GitHub
Docker dependents: 2,498
Docker downloads: 3,417,969,456
See more repository details: repos.ecosyste.ms
Last synced: about 22 hours ago