Skip to content

Commit

Permalink
docs for completion_prv
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkoMin committed Mar 12, 2024
1 parent 9b296b7 commit 4e75dd1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
26 changes: 26 additions & 0 deletions content/en/docs/commands.md
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
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

0 comments on commit 4e75dd1

Please sign in to comment.