Skip to content

Commit

Permalink
Change: Improve zsh completion installation instructions
Browse files Browse the repository at this point in the history
shtab 1.7.0 supports eval for zsh.
  • Loading branch information
bjoernricks committed Feb 26, 2024
1 parent 5b47f57 commit 9167446
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Welcome to **autohooks**!
- [Plugins](#plugins)
- [Installing autohooks](#installing-autohooks)
- [Command Completion](#command-completion)
- [Setup for bash](#setup-for-bash)
- [Setup for zsh](#setup-for-zsh)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
- [License](#license)
Expand Down Expand Up @@ -110,7 +112,7 @@ modes see the [documentation](https://greenbone.github.io/autohooks).
`autohooks` comes with support for command line completion in bash
and zsh.

Setup for bash:
### Setup for bash

```bash
echo "source ~/.autohooks-complete.bash" >> ~/.bashrc
Expand All @@ -124,12 +126,19 @@ the eval function of your bash shell:
eval "$(autohooks --print-completion bash)"
```

Setup for zsh:
### Setup for zsh

```zsh
echo 'fpath=("$HOME/.zsh.d" $fpath)' >> ~/.zsh
mkdir -p ~/.zsh.d/
autohooks --print-completion zsh > ~/.zsh.d/_greenbone_feed_sync
autohooks --print-completion zsh > ~/.zsh.d/_autohooks
```

Alternatively, you can use the result of the completion command directly with
the eval function of your zsh shell:

```bash
eval "$(autohooks --print-completion zsh)"
```

## Maintainer
Expand Down
21 changes: 5 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ python = "^3.9"
tomlkit = ">=0.5.11"
pontos = ">=22.8.0"
rich = ">=12.5.1"
shtab = ">=1.6.5"
shtab = ">=1.7.0"

[tool.poetry.dev-dependencies]
autohooks-plugin-black = ">=21.12.0"
Expand All @@ -64,9 +64,7 @@ target-version = ['py39', 'py310', 'py311', 'py312']
exclude = '''
/(
\.git
| \.hg
| \.venv
| \.circleci
| \.github
| \.vscode
| _build
Expand Down

0 comments on commit 9167446

Please sign in to comment.