Compare commits
2 commits
76744cbe71
...
e469f7593a
Author | SHA1 | Date | |
---|---|---|---|
gil | e469f7593a | ||
gil | f61367c7bf |
|
@ -1 +0,0 @@
|
||||||
example.com
|
|
28
src/main.rs
28
src/main.rs
|
@ -6,30 +6,42 @@ mod tests;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use log::error;
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(version, about, long_about = None)]
|
#[command(version, about, long_about = None)]
|
||||||
struct Cli {
|
struct Cli {
|
||||||
/// Selects a custom config file (optional)
|
/// Selects a custom config file
|
||||||
config: Option<PathBuf>,
|
config: Option<PathBuf>,
|
||||||
|
|
||||||
/// Sets output directory (optional, defaults to current directory)
|
/// Specifies files/directories for blocks
|
||||||
output_dir: Option<PathBuf>,
|
#[arg(short = 'B', long)]
|
||||||
|
|
||||||
/// Specifies block files/directories
|
|
||||||
#[arg(short, long)]
|
|
||||||
block: Vec<PathBuf>,
|
block: Vec<PathBuf>,
|
||||||
|
|
||||||
/// Specifies silence files/directories
|
/// Specifies files/directories for silences
|
||||||
#[arg(short, long)]
|
#[arg(short = 'M', long)]
|
||||||
mute: Vec<PathBuf>,
|
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 more options
|
||||||
// TODO verbose mode
|
// TODO verbose mode
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
env_logger::init();
|
||||||
|
|
||||||
let cli = Cli::parse();
|
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 argument parsing - IN PROGRESS
|
||||||
// TODO logging
|
// TODO logging
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@ impl ModActionTrust {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<(u16, u16)> for 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 {
|
fn from(value: (u16, u16)) -> Self {
|
||||||
Self {
|
Self {
|
||||||
block: value.0,
|
block: value.0,
|
||||||
|
|
Loading…
Reference in a new issue