class

Hwaro::CLI::Runner

Inherits Reference / Object

Constructors

Class methods

apply_global_quiet!(argv : Array(String))

Strip --quiet / -q from argv and enable Logger.quiet when present. Mutates the given array in place so subsequent parsers don't see it.

Source
emit_hwaro_error(err : Hwaro::HwaroError, io : IO = STDERR)

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).

Source
enable_json_mode!

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.

Source
json_mode=(value : Bool)
Source
json_mode?
Source
report_unknown_command(command : String, io : IO = STDERR)

Write a concise unknown-command error to stderr with an optional "Did you mean" suggestion. Intentionally avoids dumping the ASCII banner or full command list — users can run hwaro --help for that.

Source

Instance methods