Skip to main content

Module settings

Module settings 

Source
Expand description

The option registry: every config key in one table, with its type, default, the line that documents it, and the flag that sets it for one run, if one does.

What reads a setting is generated from or checked against this table: the -c KEY=VALUE parser, datui config keys, the commented file datui config init writes, docs/reference/settings.md, and the flags’ help. Adding an option is adding an entry here and the field it fills in datui-lib’s config structs; a test there fails until the two agree.

Structs§

EnvVar
One environment variable datui reads.
OpenOption
An option of one open, with no config key: it says how to read one file (#289), so it is a flag, a Python keyword and, for delimited text, a spec key.
Override
One -c KEY=VALUE: a key the registry knows and its value, read for the key’s kind.
Section
A config section: its title in the generated config and the reference.
Setting
One config key.

Enums§

DefaultValue
A setting’s default, as TOML.
EnvGroup
Who an environment variable belongs to, as the reference groups them.
Kind
What a setting’s value is. It decides how -c reads the text after =, and what the reference says the key takes.

Constants§

ENVIRONMENT
The environment variables datui reads, for the reference and the manpage.
OPEN
The open’s own options that Python takes as keywords, beside the config keys’.
SECTIONS
The sections, in the order the generated config and the reference list them.
SETTINGS
Every config key.
TYPES
How a value of each type is written, as Markdown: the settings reference and datui-config(5).

Functions§

by_flag
The setting a flag sets, if one does.
by_kwarg
The setting a Python keyword sets, if one does.
find
The setting key names, if any.
flag_help
A flag’s help: its setting’s doc and key. Panics on a flag no setting names, which --help and the tests reach.
in_section
The settings of section, in table order.
parse_bool
true, false and the words people use for them.
parse_value
text as the value of setting. Text needs no quotes, as with git -c.
render_environment_markdown
docs/reference/environment.md: every variable in ENVIRONMENT, by group.
render_settings_markdown
docs/reference/settings.md: every key by section, from this table. Written by gen_docs settings; a test fails while the committed page differs.
suggestions
Keys close to key: a few edits away, or a name in another section that one of them holds (comment_char and comment, so a renamed key finds its new name).