module
Noir::CLI::ConfigCommand
Overview
noir config <show|edit|init|path>
Managed resource: the user-level YAML configuration file.
Defined in:
cli/commands/config.crConstant Summary
-
ACTIONS =
Noir::CLI::Catalog::CONFIG_ACTIONS
Class Method Summary
-
.config_path(override : String | Nil = nil) : String
home: truefor the same reasonNoir::Home.pathuses it: a leading~only gets expanded by an interactive shell, and--config-filevalues routinely arrive from places that never do — the=form (--config-file=~/x.yaml) is not tilde-expanded by most shells, and Docker/systemd/CI wrappers don't expand at all. - .default_editor : String
-
.detect_legacy_keys(content : String) : Hash(String, String)
Pure helper — given a config file's body, returns the v0 keys present in it as
{old_key => v1_key}. - .edit(override_path : String | Nil = nil)
- .init
- .parse_argv(argv : Array(String)) : Parsed
-
.pick_editor : String
Resolution order: $VISUAL, $EDITOR, then a platform default.
- .print_help
- .run(argv : Array(String))
- .show(override_path : String | Nil = nil)
-
.warn_about_legacy_keys(content : String, io : IO = STDERR)
Emit a stderr hint when v0 deliver/probe keys are present in the config file.
Class Method Detail
home: true for the same reason Noir::Home.path uses it: a leading
~ only gets expanded by an interactive shell, and --config-file
values routinely arrive from places that never do — the = form
(--config-file=~/x.yaml) is not tilde-expanded by most shells, and
Docker/systemd/CI wrappers don't expand at all. Without it the path
resolved to a literal ~ directory under the cwd.
Pure helper — given a config file's body, returns the v0 keys
present in it as {old_key => v1_key}. Pulled out so the
detection rule can be exercised without going through STDERR.
Resolution order: $VISUAL, $EDITOR, then a platform default.
Empty/whitespace values are treated as unset so a stray empty
EDITOR= doesn't trap .edit into running an empty command.
Public for unit-test reach.
Emit a stderr hint when v0 deliver/probe keys are present in the
config file. The keys keep working (the migration runs at scan
time), but a user running noir config show to verify their
settings would otherwise see the raw v0 names and wonder why the
v1 documentation doesn't match what's on disk.