From 45b067620bce84cb1fae440efd7e4de78c6af63e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 04:51:21 +0000 Subject: config: variables of the program that reads a configuration A placeholder var:NAME is replaced by what the program gives under that name (Variables, Importer::fetch_with), under the rules of env:, file: and cmd:: nested in a name, a path, an argument and a shell command, as data, never as code; var+raw: where bytes go. One the program doesn't give is an error naming it and those given. So an importer that differs from one use to the next by a value is written once, with a variable. --- docs/configuration.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index e40d00e..41a4aff 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -229,10 +229,12 @@ tor-key = "${cmd:secrets ${env:HOSTNAME} show tor}" alias = { command = ["hostname-of", "${env:SITE}"] } ``` -There, only `${env:`, `${file:` and `${cmd:` begin a placeholder, or the same with -`$(`, and every other `$` stays as it is, a command's being its shell's (`$HOME`, +There, only `${env:`, `${file:`, `${cmd:` and `${var:` begin a placeholder, or the same +with `$(`, and every other `$` stays as it is, a command's being its shell's (`$HOME`, `$(…)`, `${x:-y}`); `$${` and `$$(` give the shell a `${` or a `$(` that would begin -one. What a placeholder gives goes in as it is, never +one. `${var:NAME}` is a variable of the program that reads the configuration, where it +gives any: continuum gives none, so one is an error, and a shell's own `${var:-x}` is +written `$${var:-x}`. What a placeholder gives goes in as it is, never as something to run: * into a name, a path and an argument as text, an argument staying one argument; -- cgit v1.3.1