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
- Display
Args - Filter
Args - Format
Spec - One requested output: a format and an optional file destination.
- Input
Args - Output
Args
Enums§
- Color
Arg - When to colorize output.
- Command
- Top-level subcommands. Optional — when absent, crap4rs runs the
default analysis path that requires
--coverage. - Delta
Kind Arg - Change-kind subset for
--delta-only(issue #81). - Delta
Sort KeyArg - Sort key for the delta block (issue #81).
- Format
Arg - Output format for the CRAP report.
- Group
ByArg - Group key for the displayed view (issue #64).
- Metric
Arg - Complexity metric for CRAP score computation.
- Shell
Arg - Shell name for completion script generation (#69).
- Sort
KeyArg - Sort key for the displayed view (issue #68).
Functions§
- parse_
args - Parse process args and produce a
Cli. Splits in half fromrunso the binarymain.rscan consultcli.input.src(config-aware) before constructing itsLcovParser(which needs the source root at construction time per the LCOV adapter’s path-stripping invariant).runthen consumes the parsedClidirectly. - run
- Run the CRAP CLI pipeline end-to-end. Generic over
P: ParseDiagnosticso the same orchestrator drives every adapter crate’s binary (per ADR D9, mixed-dispatch).