docs: Add ENVIRONMENT_VARIABLE configuration to README

This commit is contained in:
Maas Lalani 2022-08-08 17:06:30 -04:00
parent 9b3c8c0db0
commit 4cb290e596
No known key found for this signature in database
GPG key ID: 5A6ED5CBF1A0A000

View file

@ -152,6 +152,21 @@ gum input --cursor.foreground "#FF0" --prompt.foreground "#0FF" --prompt "* " \
--placeholder "What's up?" --width 80 --value "Not much, hby?"
```
You can also use `ENVIRONMENT_VARIABLES` to customize `gum` by default, this is
useful to keep a consistent theme for all your `gum` commands.
```bash
export GUM_INPUT_CURSOR_FOREGROUND="#FF0"
export GUM_INPUT_PROMPT_FOREGROUND="#0FF"
export GUM_INPUT_PLACEHOLDER="What's up?"
export GUM_INPUT_PROMPT="* "
export GUM_INPUT_WIDTH=80
# Uses values configured through environment variables above but can still be
# overridden with flags.
gum input
```
<picture>
<source media="(max-width: 600px)" srcset="https://stuff.charm.sh/gum/customization.gif">
<source media="(min-width: 600px)" width="600" srcset="https://stuff.charm.sh/gum/customization.gif">