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