fediloom/src/main.rs

51 lines
1.1 KiB
Rust
Raw Normal View History

// src/main.rs
mod manip;
mod tests;
2024-05-30 20:59:22 -04:00
use std::path::PathBuf;
2024-05-30 18:48:17 -04:00
use clap::Parser;
2024-05-31 01:21:27 -04:00
use log::error;
2024-05-30 18:48:17 -04:00
#[derive(Parser)]
2024-05-30 20:59:22 -04:00
#[command(version, about, long_about = None)]
2024-05-30 18:48:17 -04:00
struct Cli {
2024-05-31 01:21:27 -04:00
/// Selects a custom config file
2024-05-30 20:59:22 -04:00
config: Option<PathBuf>,
2024-05-31 01:21:27 -04:00
/// Specifies files/directories for blocks
#[arg(short = 'B', long)]
2024-05-30 20:59:22 -04:00
block: Vec<PathBuf>,
2024-05-31 01:21:27 -04:00
/// Specifies files/directories for silences
#[arg(short = 'M', long)]
2024-05-30 20:59:22 -04:00
mute: Vec<PathBuf>,
2024-05-31 01:21:27 -04:00
/// Specifies confidence in a source. Default = 100
#[arg(short, long)]
trust: Vec<u16>,
/// Sets output directory (optional, defaults to current directory)
#[arg(last = true)]
path: Option<PathBuf>,
2024-05-30 20:59:22 -04:00
// TODO more options
2024-05-30 18:48:17 -04:00
// TODO verbose mode
}
fn main() {
env_logger::init(); // TODO add more logging
2024-05-31 01:21:27 -04:00
2024-05-30 20:59:22 -04:00
let cli = Cli::parse();
2024-05-31 01:21:27 -04:00
if cli.block.is_empty() && cli.mute.is_empty() && cli.config.is_none() {
error!("No lists or configuration provided.");
}
// TODO parse config file if one is provided
// TODO read modsources from files
// TODO combine modsources into modmap
// TODO write modmap to files
2024-05-30 20:59:22 -04:00
}