diff --git a/Cargo.toml b/Cargo.toml index 5c71906..4560d34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mcmap" +name = "wwmap" version = "0.1.0" edition = "2021" diff --git a/src/cli.rs b/src/cli.rs index fb71c50..dd448e6 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,18 @@ use clap::Parser; +use std::path::PathBuf; #[derive(Parser, Debug)] -struct Args { - name: String, - count: u8 +#[clap(name = "World Wide Mapping", version, about = "Scan the world wide web for a certian port.", long_about = None)] +pub struct Args { + #[clap(help = "Which port to scan for.", short = 'p', long = "port")] + pub port: u16, + + #[clap(help = "Amount of threads that will be used when scanning for the specified port.", short = 'n', long = "threads", default_value_t = 1)] + pub threads: u8, + + #[clap(help = "A file containing ignored IPv4 addresses (seperated by linebreaks).", short = 'i', long = "ignore-ip-list", default_value = "ignore-ips-list.txt")] + pub ignorelist: PathBuf, + + #[clap(help = "Enable verbose (debug) output", short = 'v', long = "verbose", takes_value = false, required = false)] + pub verbose: bool } diff --git a/src/main.rs b/src/main.rs index a5ea142..db65208 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,11 @@ mod scanner; mod util; mod cli; -//use ipv4::IPv4; +use clap::Parser; +use cli::Args; -fn main() {} +fn main() { + let args = Args::parse(); + + println!("{:?}", args); +}