config: add --show-builtin-config and --show-config
There was no way to ask a bees build what configuration it would actually
use. The built-in schema is only readable by reading the source of the
version files, and the merged view -- builtin under global under local
under argv, with ${VAR} expanded and one schema chained onto another --
exists only inside a running daemon. An operator debugging a config
problem had to infer the answer from behaviour.
Add two options that print it. --show-builtin-config VERSION resolves a
schema version and writes what it resolves to; --show-config ROOT_PATH
loads configuration for a real filesystem and writes the merged result.
Both write to stdout and exit without starting deduplication.
The builtin form reads nothing at all: no filesystem, no config file, no
environment. That is what makes it usable offline, and it is why
--config and --option are now recorded during option parsing and applied
afterwards rather than acted on as getopt_long reaches them. Option
order belongs to the caller, so applied inline, --config f.conf
--show-builtin-config 2 would have read f.conf before the early exit ran,
and the command would be lying about what it loaded.
The output is INI, and carries the highest-priority non-blank comment for
each key along with the value, so what it prints is also documentation
for what it prints. A builtin version is dumped through the same builder
as the merged view, because with inheritance in play the text a version
registered is no longer the same thing as what that version resolves to.