Hwaro::CLI::Runner
Constructors
Class methods
Strip --quiet / -q from argv and enable Logger.quiet when present.
Mutates the given array in place so subsequent parsers don't see it.
Arguments after -- are positionals and are left alone.
Emit a classified error in either the quiet/JSON machine shape or the
human-friendly Error [CODE]: message form. JSON mode is detected
from Runner.json_mode? (set by commands that saw --json) or from
the raw ARGV (unknown-command path, before any parser runs).
Enable JSON output mode: silence human log lines and flag json_mode so
error/output payloads emit machine JSON. Call when a command parses
--json.
--json failure exit: print the classified error payload on stdout
and exit with the error's own code. Every command that handles
--json itself funnels its HwaroError rescues through here so the
envelope cannot drift between commands.
The arguments that can be flags: everything before a -- separator.
Raw-argv scans for global flags must stop there, or hwaro init -- -q
(a directory named -q) loses its only positional and falls back to
. — with --clean, emptying the current directory.
--json or its documented short form -j, before any --. The
raw-argv check for errors raised before a command's parser ran.
Classified usage error for an unknown top-level command, shared by
hwaro <command> and hwaro help <command>. The "Did you mean …"
suggestion prints to stderr (text mode only) so the final error line
emitted by run's rescue is the Error [CODE]: … form.