diff --git a/Cargo.toml b/Cargo.toml index 5709d2c..bc37b1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "fediloom" version = "0.1.0" edition = "2021" +description = "Combines blocklists for ActivityPub software" [dependencies] clap = { version = "4.5.4", features = ["derive"] } diff --git a/src/main.rs b/src/main.rs index 001b284..fce425d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,20 +3,33 @@ mod manip; mod tests; +use std::path::PathBuf; + use clap::Parser; #[derive(Parser)] +#[command(version, about, long_about = None)] struct Cli { - // TODO inputs - // TODO outputs - // TODO cfg file (TOML) - // TODO options + /// Selects a custom config file (optional) + config: Option, + + /// Sets output directory (optional, defaults to current directory) + output_dir: Option, + + /// Specifies block files/directories + #[arg(short, long)] + block: Vec, + + /// Specifies silence files/directories + #[arg(short, long)] + mute: Vec, + // TODO more options // TODO verbose mode - // } fn main() { - println!("Hello, world!"); + let cli = Cli::parse(); + // TODO argument parsing - IN PROGRESS // TODO logging -} \ No newline at end of file +} diff --git a/src/manip.rs b/src/manip.rs index e96481f..62472af 100644 --- a/src/manip.rs +++ b/src/manip.rs @@ -138,7 +138,7 @@ impl ModMap { } pub fn alphabetize_lines(string: String) -> String { - let mut v = string.lines().collect::>(); + let mut v: Vec<&str> = string.lines().collect(); v.sort_by_key(|a| a.to_lowercase()); v.join("\n") + "\n"