Prettify + tinker with clap options

This commit is contained in:
gil 2024-06-02 01:24:54 -05:00
parent 0438084eeb
commit 58ef806e56
2 changed files with 9 additions and 17 deletions

View file

@ -22,6 +22,10 @@ struct Cli {
#[arg(short = 'M', long)] #[arg(short = 'M', long)]
mute: Vec<PathBuf>, mute: Vec<PathBuf>,
/// Specifies a source (*.block.txt, *.mute.txt)
#[arg(short = 'S', long)]
src: Vec<PathBuf>,
/// Specifies confidence in a source. Default = 100 /// Specifies confidence in a source. Default = 100
#[arg(short, long)] #[arg(short, long)]
trust: Vec<u16>, trust: Vec<u16>,
@ -41,7 +45,7 @@ fn main() {
if cli.block.is_empty() && cli.mute.is_empty() && cli.config.is_none() { if cli.block.is_empty() && cli.mute.is_empty() && cli.config.is_none() {
error!("No lists or configuration provided."); error!("No lists or configuration provided.");
} }
// TODO parse config file if one is provided // TODO parse config file if one is provided
// TODO read modsources from files // TODO read modsources from files

View file

@ -111,14 +111,8 @@ fn mergedlist_from_limitlist() {
let test_ml = MergedLimitList { let test_ml = MergedLimitList {
map: HashMap::from([ map: HashMap::from([
(String::from("example.com"), LimitIndices::from((200, 0))), (String::from("example.com"), LimitIndices::from((200, 0))),
( (String::from("example.org"), LimitIndices::from((100, 100))),
String::from("example.org"), (String::from("example.net"), LimitIndices::from((100, 100))),
LimitIndices::from((100, 100)),
),
(
String::from("example.net"),
LimitIndices::from((100, 100)),
),
]), ]),
max: 200, max: 200,
}; };
@ -146,14 +140,8 @@ fn mergedlist_from_limitlist() {
let test_ml = MergedLimitList { let test_ml = MergedLimitList {
map: HashMap::from([ map: HashMap::from([
(String::from("example.com"), LimitIndices::from((450, 0))), (String::from("example.com"), LimitIndices::from((450, 0))),
( (String::from("example.org"), LimitIndices::from((100, 300))),
String::from("example.org"), (String::from("example.net"), LimitIndices::from((100, 150))),
LimitIndices::from((100, 300)),
),
(
String::from("example.net"),
LimitIndices::from((100, 150)),
),
]), ]),
max: 450, max: 450,
}; };