aboutsummaryrefslogtreecommitdiffstats
path: root/docs/configuration.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-02 17:50:30 +0000
committertv <tv@krebsco.de>2026-12-02 17:50:30 +0000
commit9f64a8d003bd301a6499bf7a6f60e6cf0b533162 (patch)
treeba74b70f52fe6eb0c639e272709b1ae33dd8d201 /docs/configuration.md
parent2be9ca2b75d099a9ca04078f2182acda074ed270 (diff)
config: a named importer used with several variablesHEADmaster
In a file, { NAME = { host = "…", key = "…" } } uses the importer NAME with those variables; { NAME = "REST" } is short for the one variable `name`, which the argument and the placeholder give. A variable the importer is given and never asks for is an error naming it and those it takes, as one it asks for and isn't given is; one that takes none is used with nothing after its name. Such a use is shown as NAME(host = …, key = …), as written, and Source::Named holds the variables, for a program that reports by them.
Diffstat (limited to 'docs/configuration.md')
-rw-r--r--docs/configuration.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/configuration.md b/docs/configuration.md
index 79e5965..b286463 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -301,6 +301,23 @@ itself. What follows the name goes in as every variable does: as it is, one argu
one word of a shell command, never as something to run. It may hold placeholders, and
an importer may be defined through others named, but not through itself.
+In a file, an importer may be used with several variables, a table of them in place of
+the text, each named as importers are:
+
+```toml
+[meta.importer]
+secrets = { command = ["secrets", "$(var:host)", "show", "$(var:key)"] }
+
+tor-key = { secrets = { host = "web", key = "tor" } }
+```
+
+`{ NAME = "REST" }` is short for `{ NAME = { name = "REST" } }`. A variable the importer
+asks for and isn't given is an error that names it, and so is one it is given and never
+asks for, a misspelt one most likely; one that takes none is used with nothing after
+its name (`{ NAME = "" }`, `NAME:`). An importer's own relative paths, and where its
+commands run, go by the file that names it; those in what it is used with, by the file
+that uses it.
+
A name is small letters, digits and `-`, a letter first, and none of `env`, `file`,
`cmd`, `command`, `var`, `literal` and `format`. Where it isn't named, `pass:x` is
what it was before: text on the command line, an unknown key in a file.