Skip to content

Commit 4af2be4

Browse files
committed
Add instructions for enabling tab completions
1 parent ff0c17a commit 4af2be4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,33 @@ WSL-based installation.
252252
See [here](INSTALL_FROM_SOURCE.md).
253253

254254

255+
## Shell Tab Completion
256+
257+
Tab completion is available for the following shells: Bash, Zsh, and Tcsh.
258+
259+
To enable tab completion, run the following command to generate the appropriate script:
260+
261+
```bash
262+
fairseq2 --print-completion {bash|zsh|tcsh}
263+
```
264+
265+
You can either save the output to the shell's completion directory for permanent use or apply it directly to your current session.
266+
267+
For example, to enable Bash completion for the current session, use:
268+
```bash
269+
eval "$(fairseq2 --print-completion bash)"
270+
```
271+
272+
For a permanent setup, run the following command to store the completion script:
273+
```bash
274+
echo "eval $(fairseq2 --print-completion bash)" >> "$BASH_COMPLETION_COMPAT_DIR/shtab"
275+
```
276+
277+
Here, `BASH_COMPLETION_COMPAT_DIR` is the path to your system's shell completion directory.
278+
279+
This ensures that tab completion will be enabled every time you start a new shell session.
280+
281+
255282
## Contributing
256283
We always welcome contributions to fairseq2! Please refer to
257284
[Contribution Guidelines](CONTRIBUTING.md) to learn how to format, test, and

0 commit comments

Comments
 (0)