module Noir::CLI::Router

Overview

Top-level subcommand router.

noir scan ./app → ScanCommand noir list techs → ListCommand noir cache info → CacheCommand noir config show → ConfigCommand noir rules update → RulesCommand noir completion zsh → CompletionCommand noir version → VersionCommand noir help → HelpCommand

Anything else (including the v0 noir -b ./app pattern) routes to scan — the default — preserving every CI script, GitHub Action, Dockerfile entrypoint, and shell alias from v0.x.

Defined in:

cli/router.cr

Constant Summary

GLOBAL_FLAGS = ["--no-color", "--no-spinner"]

Router-consumed global flags. apply_global_color_flag! already acted on --no-color, and --no-spinner only means anything to a scan's loading spinner. Neither is meaningful to the thin subcommands, whose "first positional = action/subject" parsers would otherwise misread a leading --no-color as the action itself (Unknown cache action: --no-color). They're stripped before those commands parse. scan is deliberately excluded: its own OptionParser re-reads both flags to thread color/spinner state through NoirRunner, so scan keeps the full argv.

Class Method Summary

Class Method Detail

def self.dispatch(argv : Array(String) = ARGV) #

[View source]
def self.strip_global_flags(args : Array(String)) : Array(String) #

Pure helper (no exit/die) so the strip rule stays unit-testable.


[View source]