Skip to content

Commit

Permalink
docs: simplify CLI documentation for autocompletion (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Feb 11, 2024
1 parent 7d60515 commit bbd701f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions docs/cli_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
We support shell completions through clap-complete.
You can generate them for your shell using the `completion` command.

E.g.,
You can add the completions to your shell by adding the following to your shell's configuration file.

```sh
rattler-build completion --shell=zsh > ${ZSH_COMPLETIONS_PATH:~/.zsh/completions}/_rattler-build
compinit
# For bash (add this to ~/.bashrc)
eval "$(rattler-build completion --shell=bash)"
# For zsh (add this to ~/.zshrc)
eval "$(rattler-build completion --shell=zsh)"
# For fish (add this to ~/.config/fish/config.fish)
rattler-build completion --shell=fish | source
```

Ensure that whereever you install the is pointed to by your FPATH (for zsh or equivalent in other shells).
Expand All @@ -21,12 +25,6 @@ build -- Build a package
help -- Print this message or the help of the given subcommand(s)
rebuild -- Rebuild a package
test -- Test a package
```

Example for Fish Shell just generate the `completions.fish` and add to `~/.config/fish/completions`.
```sh
rattler-build completion --shell=fish > ${ZSH_COMPLETIONS_PATH:~/.config/fish/completions}/rattler-build.fish
```

## Package format

Expand All @@ -38,6 +36,6 @@ For `.conda`, you can also set the `--compression-threads` flag to specify the n
```sh
# default
rattler-build build --package-format tarbz2 -r recipe/recipe.yaml
# maximum compression
# maximum compression with 10 threads
rattler-build build --package-format conda:max --compression-threads 10 -r recipe/recipe.yaml
```

0 comments on commit bbd701f

Please sign in to comment.