module Noir::CLI

Defined in:

cli/common.cr

Constant Summary

KNOWN_COMMANDS = ["scan", "list", "cache", "config", "rules", "completion", "version", "help"]

Known top-level verbs. The router falls back to scan when ARGV[0] is not one of these (preserving the noir -b ./app v0 usage pattern).

Class Method Summary

Class Method Detail

def self.apply_global_color_flag!(argv : Array(String)) : Nil #

Disable Crystal's Colorize globally when the user asks for plain output via --no-color or the NO_COLOR env var. Applied at the router layer so every subcommand (list / cache / config / rules / completion / version / help / scan) picks it up. Scan's own parser still sees --no-color and threads it through NoirRunner for the in-scan logger.


[View source]
def self.die(message : String, code : Int32 = 1) : NoReturn #

[View source]
def self.name(label : String) : String #

[View source]
def self.no_color_env? : Bool #

NO_COLOR follows the convention at https://no-color.org: any non-empty value disables color, with the explicit exception of "0".


[View source]
def self.section(label : String) : String #

Shared accent helpers so every -h page styles its section labels and inline command names the same way. Green for headers (USAGE, SUBJECTS, ACTIONS, OPTIONS, ...). Cyan for the named items inside.


[View source]