feat: bash and (fi)zsh completion along with docs

This commit is contained in:
2021-09-07 13:15:01 +02:00
parent 48bc03db51
commit 1757fabb89
5 changed files with 75 additions and 0 deletions

View File

@ -38,6 +38,27 @@ make install
The abra binary will be in `$GOPATH/bin`.
## Autocompletion
**bash**
Copy `autocomplete/bash_autocomplete` into `/etc/bash_completion.d/` and rename
it to abra.
```
sudo cp autocomplete/bash_autocomplete /etc/bash_completion.d/abra
source /etc/bash_completion.d/abra
```
**(fi)zsh**
(fi)zsh doesn't have an autocompletion folder by default but you can create one, then copy `zsh_autocomplete` into it and add a couple lines to your `~/.zshrc` or `~/.fizsh/.fizshrc`
```
sudo mkdir /etc/zsh/completion.d/
sudo cp autocomplete/zsh_autocomplete /etc/zsh/completion.d/abra
echo "PROG=abra\n_CLI_ZSH_AUTOCOMPLETE_HACK=1\nsource /etc/zsh/completion.d/abra" >> ~/.zshrc
```
(replace .zshrc with ~/.fizsh/.fizshrc if you use fizsh)
## Hacking
Install direnv, run `cp .envrc.sample .envrc`, then run `direnv allow` in this directory. This will set coopcloud repos as private due to [this bug.](https://git.coopcloud.tech/coop-cloud/coopcloud.tech/issues/20#issuecomment-8201). Or you can run `go env -w GOPRIVATE=coopcloud.tech` but I'm not sure how persistent this is.