Add docs for environment variables

This commit is contained in:
Ivan Habunek 2023-12-07 20:05:58 +01:00
parent 0848a6f7df
commit 875bf2d86a
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
2 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,7 @@
- [Advanced](advanced.md)
- [Settings](settings.md)
- [Shell completion](shell_completion.md)
- [Environment variables](environment_variables.md)
- [TUI](tui.md)
- [Contributing](contributing.md)
- [Documentation](documentation.md)

View File

@ -0,0 +1,19 @@
# Environment variables
> Introduced in toot v0.40.0
Toot allows setting defaults for parameters via environment variables.
Environment variables should be named `TOOT_<COMMAND_NAME>_<OPTION_NAME>`.
### Examples
Command with option | Environment variable
------------------- | --------------------
`toot --color` | `TOOT_COLOR=true`
`toot --no-color` | `TOOT_COLOR=false`
`toot post --editor vim` | `TOOT_POST_EDITOR=vim`
`toot post --visibility unlisted` | `TOOT_POST_VISIBILITY=unlisted`
`toot tui --media-viewer feh` | `TOOT_TUI_MEDIA_VIEWER=feh`
Note that these can also be set via the [settings file](./settings.html).