Compare commits

...

2 commits

Author SHA1 Message Date
gil e469f7593a Removing url from deps (for now) 2024-05-31 00:21:49 -05:00
gil f61367c7bf Check if required args provided 2024-05-31 00:21:27 -05:00
4 changed files with 22 additions and 11 deletions

View file

@ -1 +0,0 @@
example.com

View file

@ -1,2 +0,0 @@
example.net
example.org

View file

@ -6,30 +6,42 @@ mod tests;
use std::path::PathBuf;
use clap::Parser;
use log::error;
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {
/// Selects a custom config file (optional)
/// Selects a custom config file
config: Option<PathBuf>,
/// Sets output directory (optional, defaults to current directory)
output_dir: Option<PathBuf>,
/// Specifies block files/directories
#[arg(short, long)]
/// Specifies files/directories for blocks
#[arg(short = 'B', long)]
block: Vec<PathBuf>,
/// Specifies silence files/directories
#[arg(short, long)]
/// Specifies files/directories for silences
#[arg(short = 'M', long)]
mute: Vec<PathBuf>,
/// 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>,
// TODO more options
// TODO verbose mode
}
fn main() {
env_logger::init();
let cli = Cli::parse();
if cli.block.is_empty() && cli.mute.is_empty() && cli.config.is_none() {
error!("No lists or configuration provided.");
}
// TODO argument parsing - IN PROGRESS
// TODO logging
}

View file

@ -31,6 +31,8 @@ impl ModActionTrust {
}
impl From<(u16, u16)> for ModActionTrust {
/// Creates mod action weights from a tuple of two `u16` weights. Useful
/// mostly for testing.
fn from(value: (u16, u16)) -> Self {
Self {
block: value.0,