Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs for completion_prv #127

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions content/en/docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,32 @@ After ensuring all dependencies are available, and fetching them if they are not
| ---------------- | ---- | ---------------------------------------------------------|
| `-d/--deps_only` | none | Only compile dependencies, no project apps will be built |

## completion
{{% blocks/callout type="info" title="Since version 3.23.0" %}}
{{< /blocks/callout >}}
Generates a completion file for one of the supported shells: `bash`, `zsh`.

Completion files can be generated based on the project setup, so autocompletion also works for all plugins used in the project, not just for default providers.

To use generated completion files run `source path/to/generated/file`.

| Option | Type | Description |
| ------- | ------- | --------- |
| `-a/--aliases` | Comma separated list of strings | OS level aliases on which rebar3 completion will be triggered (e.g. `"rebar, r3"`) |
| `-f/--file` | string | Completion file name. If not absolute, it's relative to the `_build/<profile>/` directory |
| `-s/--shell` | atom | Specify type of the completion file. By default it is autodected using `$SHELL` variable. Valid values are `bash` and `zsh`.

{{% blocks/callout type="warning" title="zsh specific requirement" %}}
Make sure that `autoload -Uz compinit; compinit` is called in `.zshrc` file.
{{< /blocks/callout >}}

For better user experience, set default autocompletion and override it when needed.
Default autocompletion can be set by generating a global completion file and loading it in `.bashrc` or `.zshrc`.

To generate a global (project-independent) completion file run `rebar3 completion --file path/to/global/completion/file` outside a `rebar3` project.



## clean

Removes compiled BEAM files from apps.
Expand Down
13 changes: 12 additions & 1 deletion content/en/docs/configuration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,17 @@ Disable recursive compiling on test and other dirs:
}.
```

## Completion

```erlang
{completion,
[{aliases,["rebar", "r3"]},
{file, "/home/user/completion/_rebar3"},
{shell, bash}]}.
```

Options mirror those specified in [Commands](/docs/commands#completion) arguments.

## Common Test

```erlang
Expand All @@ -203,7 +214,7 @@ Reference of common test options for `ct_opts`: [https://www.erlang.org/doc/man/

A special option allows to load a default `sys.config` set of entries using `{ct_opts, [{sys_config, ["name.of.config"]}]}`. From the command line, it is however specified as `--sys_config name.of.config`.

Options often exist mirroring those that can be specified in [Commands](/docs/commands) arguments.
Options often exist mirroring those that can be specified in [Commands](/docs/commands/#ct) arguments.

## Cover

Expand Down