summaryrefslogtreecommitdiffstats
path: root/docs/config
diff options
context:
space:
mode:
authorGabriel Victor <64982761+gabrielvictorcf@users.noreply.github.com>2021-11-15 02:46:13 -0300
committerGitHub <noreply@github.com>2021-11-15 06:46:13 +0100
commit779e53cd66c56f13f55c4ad1367da1247cf44fdc (patch)
treed92b18359be44da027af2f96ebe404b410ab148f /docs/config
parentc3e33ea1c77e86cefabff09bfb7c55d10c9e541d (diff)
feat(module): Add `sudo` module (#3135)
* add feature - sudo module * add sudo module identifiers and entry point * fix test test_sudo_not_cached * add test test_sudo_cached * add `allow_windows` and `binary` options * rustfmt sudo_x_cached and rmv them on windows * add false `allow_windows` block windows test * add `doas` cached/not_cached tests * better description in `starship explain` * fix `test_doas_cached` with `-n` flag Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * rmv `binary` alternatives and their tests * fix symbol and update config/README * fix all mocks to use `sudo -n true` * fix expected output in `test_sudo_cached` * proper checking for blocked sudo Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * add `allow_windows = true` to non-windows tests * allow sudo_* tests to run on windows + fix parsed * rustfmt `blocks_windows` test Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Diffstat (limited to 'docs/config')
-rw-r--r--docs/config/README.md53
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/config/README.md b/docs/config/README.md
index 2ba70b452..b5be43da4 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -243,6 +243,7 @@ $openstack\
$env_var\
$crystal\
$custom\
+$sudo\
$cmd_duration\
$line_break\
$jobs\
@@ -2947,6 +2948,58 @@ disabled = false
```
+## Sudo
+
+The `sudo` module displays if sudo credentials are currently cached.
+The module will only be shown if credentials are cached.
+
+::: tip
+
+This module is disabled by default.
+To enable it, set `disabled` to `false` in your configuration file.
+
+:::
+
+### Options
+
+| Option | Default | Description |
+| -------------- | ----------------------- | ------------------------------------------------------------ |
+| `format` | `[as $symbol]($style)"` | The format of the module |
+| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
+| `style` | `"bold blue"` | The style for the module. |
+| `allow_windows`| `false` | Since windows has no default sudo, default is disabled. |
+| `disabled` | `true` | Disables the `sudo` module. |
+
+### Variables
+
+| Variable | Example | Description |
+| --------- | ------- | ------------------------------------ |
+| symbol | | Mirrors the value of option `symbol` |
+| style\* | | Mirrors the value of option `style` |
+
+\*: This variable can only be used as a part of a style string
+
+### Example
+
+```toml
+
+# ~/.config/starship.toml
+
+[sudo]
+style = "bold green"
+symbol = "👩‍💻 "
+disabled = false
+```
+
+```toml
+# On windows
+# $HOME\.starship\config.toml
+
+[sudo]
+allow_windows = true
+disabled = false
+```
+
## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/).