Skip to main content

crap4rust/
lib.rs

1// Copyright 2025 Umberto Gotti <umberto.gotti@umbertogotti.dev>
2// Licensed under the MIT License or Apache License, Version 2.0
3// SPDX-License-Identifier: MIT OR Apache-2.0
4
5pub mod app;
6pub mod cli;
7pub mod complexity;
8pub mod coverage;
9pub mod coverage_index;
10mod export;
11pub mod file_walker;
12pub mod impl_collector;
13pub mod llvm_cov_builder;
14pub mod manifest;
15pub mod model;
16pub mod report;
17mod source;
18pub mod source_root_collector;
19
20use std::process::ExitCode;
21
22use anyhow::Result;
23
24pub fn run() -> Result<ExitCode> {
25    let args = cli::Args::parse_args();
26    app::run(args)
27}
28
29pub fn run_from_args<I, T>(args: I) -> Result<ExitCode>
30where
31    I: IntoIterator<Item = T>,
32    T: Into<std::ffi::OsString> + Clone,
33{
34    let args = <cli::Args as clap::Parser>::parse_from(args);
35    app::run(args)
36}