Skip to content

Commit

Permalink
Change: Document how to use shell command completion
Browse files Browse the repository at this point in the history
Explain how to install the command completion for bash and zsh.
  • Loading branch information
bjoernricks committed Feb 26, 2024
1 parent 44a00a9 commit f5981a5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 15 deletions.
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ the titan of the sea.
- [Install using pipx](#install-using-pipx)
- [Install using pip](#install-using-pip)
- [Install using poetry](#install-using-poetry)
- [Command Completion](#command-completion)
- [Setup for bash](#setup-for-bash)
- [Setup for zsh](#setup-for-zsh)
- [Development](#development)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
Expand Down Expand Up @@ -66,12 +69,48 @@ a dependency for your current project using [poetry]

poetry add pontos

## Command Completion

`pontos` comes with support for command line completion in bash and zsh. All
pontos CLI commands support shell completion. As examples the following sections
explain how to set up the completion for `pontos-release` with bash and zsh.

### Setup for bash

```bash
echo "source ~/.pontos-release-complete.bash" >> ~/.bashrc
pontos-release --print-completion bash > ~/.pontos-release-complete.bash
```

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

```bash
eval "$(pontos-release --print-completion bash)"
```

### Setup for zsh

```zsh
echo 'fpath=("$HOME/.zsh.d" $fpath)' >> ~/.zsh
mkdir -p ~/.zsh.d/
pontos-release --print-completion zsh > ~/.zsh.d/_pontos_release
```

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

```bash
eval "$(pontos-release --print-completion zsh)"
```


## Development

**pontos** uses [poetry] for its own dependency management and build
process.

First install poetry via pipx
First install poetry via [pipx]

python3 -m pipx install poetry

Expand Down
15 changes: 2 additions & 13 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ rich = ">=12.4.4"
python-dateutil = ">=2.8.2"
semver = ">=2.13"
lxml = ">=4.9.0"
shtab = ">=1.6.5"
shtab = ">=1.7.0"

[tool.poetry.group.dev.dependencies]
autohooks = ">=22.7.0"
Expand Down

0 comments on commit f5981a5

Please sign in to comment.