Skip to main content

Module cli

Module cli 

Source
Expand description

CLI entry point — thin shell over the library crate.

Parses args with clap, validates inputs, delegates to core::analyze(). No business logic lives here.

Relocated from crap4rs::cli in S4 (#136). The orchestrator cli::run<P> is generic over the coverage adapter’s parse-diagnostic type so the same dispatch shell drives every adapter binary (crap4rs, future crap4ts). Per-binary main.rs supplies the complexity + coverage ports as &dyn trait objects (ADR D9).

Structs§

Cli
DisplayArgs
FilterArgs
FormatSpec
One requested output: a format and an optional file destination.
InputArgs
OutputArgs

Enums§

ColorArg
When to colorize output.
Command
Top-level subcommands. Optional — when absent, crap4rs runs the default analysis path that requires --coverage.
DeltaKindArg
Change-kind subset for --delta-only (issue #81).
DeltaSortKeyArg
Sort key for the delta block (issue #81).
FormatArg
Output format for the CRAP report.
GroupByArg
Group key for the displayed view (issue #64).
MetricArg
Complexity metric for CRAP score computation.
ShellArg
Shell name for completion script generation (#69).
SortKeyArg
Sort key for the displayed view (issue #68).

Functions§

parse_args
Parse process args and produce a Cli. Splits in half from run so the binary main.rs can consult cli.input.src (config-aware) before constructing its LcovParser (which needs the source root at construction time per the LCOV adapter’s path-stripping invariant). run then consumes the parsed Cli directly.
run
Run the CRAP CLI pipeline end-to-end. Generic over P: ParseDiagnostic so the same orchestrator drives every adapter crate’s binary (per ADR D9, mixed-dispatch).