feat(erlang): Configure when the module is shown (#2346)

* feat(erlang): Configure when the module is shown

This makes it possible to configure when the erlang module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.

* Update docs/config/README.md

Co-authored-by: Shu Kutsuzawa <cappyzawa@gmail.com>

Co-authored-by: Shu Kutsuzawa <cappyzawa@gmail.com>
This commit is contained in:
Thomas O'Donnell
2021-02-21 13:20:14 +01:00
committed by GitHub
parent 7331e4bec6
commit 873a005c42
3 changed files with 22 additions and 15 deletions
+10 -7
View File
@@ -944,19 +944,22 @@ default = "unknown shell"
## Erlang
The `erlang` module shows the currently installed version of Erlang/OTP.
The module will be shown if any of the following conditions are met:
By default the module will be shown if any of the following conditions are met:
- The current directory contains a `rebar.config` file.
- The current directory contains a `erlang.mk` file.
### Options
| Option | Default | Description |
| ---------- | ---------------------------------- | -------------------------------------------------------- |
| `symbol` | `" "` | The symbol used before displaying the version of erlang. |
| `style` | `"bold red"` | The style for the module. |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `disabled` | `false` | Disables the `erlang` module. |
| Option | Default | Description |
| ------------------- | ------------------------------------ | -------------------------------------------------------- |
| `symbol` | `" "` | The symbol used before displaying the version of erlang. |
| `style` | `"bold red"` | The style for the module. |
| `detect_extensions` | `[]` | Which extensions should trigger this module. |
| `detect_files` | `["rebar.config", "elang.mk"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `disabled` | `false` | Disables the `erlang` module. |
### Variables