Skip to content

Commit c63f4eb

Browse files
authored
Add auto-completion docs (#273)
1 parent 0c16ede commit c63f4eb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Most of the Meson commands listed below should work "out of the box" for those.
3030
- [Argument overrides](#argument-overrides)
3131
- [Advanced: adding arguments to built-in commands](#advanced-adding-arguments-to-built-in-commands)
3232
- [Advanced: override Meson CLI](#advanced-override-meson-cli)
33+
- [Auto-completion](#auto-completion)
3334
- [FAQ](#faq)
3435
- [For contributors](#for-contributors)
3536
- [History](#history)
@@ -245,6 +246,28 @@ Meson CLI can be set in `pyproject.toml`:
245246
cli = 'path/to/custom/meson'
246247
```
247248

249+
## Auto-completion
250+
251+
To enable shell auto-completion, first install `spin`, then follow these instructions
252+
(from the [click documentation](https://click.palletsprojects.com/en/stable/shell-completion/#enabling-completion)).
253+
The same instructions work for ZSH, just replace "bash" with "zsh".
254+
255+
1. Create a completions file:
256+
257+
```
258+
_SPIN_COMPLETE=bash_source spin > ~/.spin-complete.bash
259+
```
260+
261+
Ignore the "need valid configuration" error messages.
262+
263+
2. In your `~/.bashrc`, add:
264+
265+
```
266+
source ~/.spin-complete.bash
267+
```
268+
269+
Auto-completions should now work in any spin-enabled project directory.
270+
248271
## FAQ
249272

250273
- Running `spin`, the emojis in the command list don't show up.

0 commit comments

Comments
 (0)