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.

cli::run<P> is generic over the coverage adapter’s parse-diagnostic type so the same dispatch shell drives every adapter binary. The per-binary main.rs supplies the complexity + coverage ports as &dyn trait objects (ADR D9) plus an AdapterMeta carrying the binary’s name, version, help copy, extensions, and config-file name.

Structs§

AdapterMeta
Adapter-supplied runtime metadata that crap-core threads through parse_args, run, and the reporter call sites.
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, the analyzer runs the default analysis path that requires --coverage.
DeltaKindArg
Change-kind subset for --delta-only.
DeltaSortKeyArg
Sort key for the delta block.
FormatArg
Output format for the CRAP report.
GroupByArg
Group key for the displayed view.
MetricArg
Complexity metric for CRAP score computation.
ShellArg
Shell name for completion script generation.
SortKeyArg
Sort key for the displayed view.

Functions§

parse_args
Parse process args into Cli, splicing the adapter’s runtime metadata into clap’s help / --version output.
run
Run the CRAP CLI pipeline end-to-end.