Add beginnings of CLI parsing
This commit is contained in:
parent
1091399fec
commit
76744cbe71
|
@ -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"] }
|
||||
|
|
25
src/main.rs
25
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<PathBuf>,
|
||||
|
||||
/// Sets output directory (optional, defaults to current directory)
|
||||
output_dir: Option<PathBuf>,
|
||||
|
||||
/// Specifies block files/directories
|
||||
#[arg(short, long)]
|
||||
block: Vec<PathBuf>,
|
||||
|
||||
/// Specifies silence files/directories
|
||||
#[arg(short, long)]
|
||||
mute: Vec<PathBuf>,
|
||||
// TODO more options
|
||||
// TODO verbose mode
|
||||
//
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
let cli = Cli::parse();
|
||||
|
||||
// TODO argument parsing - IN PROGRESS
|
||||
// TODO logging
|
||||
}
|
|
@ -138,7 +138,7 @@ impl ModMap {
|
|||
}
|
||||
|
||||
pub fn alphabetize_lines(string: String) -> String {
|
||||
let mut v = string.lines().collect::<Vec<&str>>();
|
||||
let mut v: Vec<&str> = string.lines().collect();
|
||||
v.sort_by_key(|a| a.to_lowercase());
|
||||
|
||||
v.join("\n") + "\n"
|
||||
|
|
Loading…
Reference in a new issue