feat(red,vlang): Add version formatting (#2987)

Have added version formatting to the red and vlang modules. Note the
docs for red already mentioned the `version_format` string but it had
not actually been added.
This commit is contained in:
Thomas O'Donnell
2021-08-15 21:30:58 +02:00
committed by GitHub
parent 7038ae2ec8
commit 9e5fcd1e14
5 changed files with 67 additions and 27 deletions
+11 -10
View File
@@ -3044,21 +3044,22 @@ By default the module will be shown if any of the following conditions are met:
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------- | -------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `symbol` | `"V "` | A format string representing the symbol of V |
| `detect_extensions` | `["v"]` | Which extensions should trigger this module. |
| `detect_files` | `["v.mod", "vpkg.json", ".vpkg-lock.json" ]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"blue bold"` | The style for the module. |
| `disabled` | `false` | Disables the `vlang` module. |
| Option | Default | Description |
| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"V "` | A format string representing the symbol of V |
| `detect_extensions` | `["v"]` | Which extensions should trigger this module. |
| `detect_files` | `["v.mod", "vpkg.json", ".vpkg-lock.json" ]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"blue bold"` | The style for the module. |
| `disabled` | `false` | Disables the `vlang` module. |
### Variables
| Variable | Example | Description |
| -------- | -------- | ------------------------------------ |
| version | `v0.2` | The version of `v` |
| version | `v0.2` | The version of `v` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |