Skip to main content

Module warn

Module warn 

Source
Expand description

Lightweight warning system for hyalo CLI.

Provides:

  • Quiet mode: suppress all warnings when -q / --quiet is set.
  • Dedup tracking: identical warning messages are counted but only printed once; flush_summary() reports how many were suppressed.

§Initialisation

Call init(quiet) as early as possible after CLI flags are parsed. Until init is called the system defaults to non-quiet mode, so any warnings emitted before initialisation (e.g. from config loading) are still printed.

§Usage

warn::init(cli.quiet);
// ...
warn::warn("skipping foo.md: invalid frontmatter");
// ...
warn::flush_summary();

Functions§

flush_summary
Print a summary of suppressed duplicate warnings, if any.
init
Initialise the warning system.
warn
Emit a warning message to stderr.
warn_glob_dir_overlap
Emit a “did you mean…” warning when globs matched zero files and the glob pattern appears to redundantly include the configured --dir path.