Skip to content

Commit

Permalink
Make shell completion instructions more generic for other shells
Browse files Browse the repository at this point in the history
For a while now we have supported the generation of argument completion
scripts for various shells. Yet, the README was only talking about the
usage of bash.
This change updates the document to at least mention the possibility of
creation of such completion scripts for other shells.
  • Loading branch information
d-e-s-o committed Apr 10, 2021
1 parent c40742c commit cf02dbd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,23 @@ It is recommended that the resulting executable be installed in a
directory accessible via the `PATH` environment variable.


#### Bash Completion
**nitrocli** comes with Bash completion support for options and
arguments to them. A completion script can be generated via the
#### Shell Completion
**nitrocli** comes with completion support for options and arguments to
them (for various shells). A completion script can be generated via the
`shell-complete` utility program and then only needs to be sourced to
make the current shell provide context-sensitive tab completion support.
```bash
$ cargo run --bin=shell-complete bash > nitrocli.bash
$ source nitrocli.bash
```

The generated completion script can be installed system-wide as usual
and sourced through Bash initialization files, such as `~/.bashrc`.
The generated completion script (`bash` specific, in this case) can be
installed system-wide as usual and sourced through Bash initialization
files, such as `~/.bashrc`.

Completion scripts for other shells work in a similar manner. Please
refer to the help text (`--help`) of the `shell-complete` program for
the list of supported shells.


Known Problems
Expand Down

0 comments on commit cf02dbd

Please sign in to comment.