uf/
lib.rs

1#![doc = include_str!("../README.md")]
2#![warn(
3    clippy::cargo,
4    clippy::pedantic,
5    clippy::absolute_paths,
6    clippy::allow_attributes_without_reason,
7    clippy::dbg_macro,
8    clippy::exit,
9    clippy::panic,
10    clippy::todo,
11    clippy::unimplemented,
12    clippy::unwrap_used,
13    missing_debug_implementations,
14    missing_docs
15)]
16// The following lints are enable by default in clippy::pedantic, but are disabled here because
17// they are too aggressive.
18#![allow(clippy::module_name_repetitions, reason = "Occasionally useful")]
19#![allow(clippy::too_many_lines, reason = "This is not bad in my opinion")]
20
21use std::process::ExitCode;
22
23mod cli;
24pub(crate) use cli::Cli;
25
26mod config;
27pub(crate) use config::Config;
28
29mod mime;
30pub(crate) use mime::MimeType;
31
32/// Run the application.
33#[must_use]
34pub fn run() -> ExitCode {
35    let args = Cli::parse();
36    match args.run() {
37        Ok(()) => ExitCode::SUCCESS,
38        Err(error) => {
39            eprintln!("Error: {error:#}");
40            ExitCode::FAILURE
41        }
42    }
43}