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;
8mod coverage;
9mod manifest;
10pub mod model;
11mod report;
12mod source;
13
14use std::process::ExitCode;
15
16use anyhow::Result;
17
18pub fn run() -> Result<ExitCode> {
19    let args = cli::Args::parse_args();
20    app::run(args)
21}
22
23pub fn run_from_args<I, T>(args: I) -> Result<ExitCode>
24where
25    I: IntoIterator<Item = T>,
26    T: Into<std::ffi::OsString> + Clone,
27{
28    let args = <cli::Args as clap::Parser>::parse_from(args);
29    app::run(args)
30}