feat: Implement configuration to display pyenv version name (#140)

This behavior can be enabled via setting `use_pyenv` to true.
The "pyenv" prefix before the version name can be configured using `pyenv_prefix`.
This commit is contained in:
MaT1g3R
2019-08-12 21:12:55 -04:00
committed by Matan Kushner
parent 274042832d
commit 160a79fa06
4 changed files with 95 additions and 28 deletions
+11 -1
View File
@@ -350,8 +350,13 @@ symbol = "🎁 "
## Python
The `python` module shows the currently installed version of Python.
It will also show the current Python virtual environment if one is
If `pyenv_version_name` is set to `true`, it will display the pyenv version name.
Otherwise, it will display the version number from `python --version`
and show the current Python virtual environment if one is
activated.
The module will be shown if any of the following conditions are met:
- The current directory contains a `.python-version` file
@@ -365,6 +370,9 @@ The module will be shown if any of the following conditions are met:
| ---------- | ------- | -------------------------------------------------------- |
| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. |
| `disabled` | `false` | Disables the `python` module. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) |
### Example
@@ -373,6 +381,8 @@ The module will be shown if any of the following conditions are met:
[python]
symbol = "👾 "
pyenv_version_name = true
pyenv_prefix = "foo "
```
## Rust