CLI arguments

main
E. Almqvist 2 years ago
parent 3f1aa3d65e
commit 483dda0bb6
  1. 2
      Cargo.toml
  2. 17
      src/cli.rs
  3. 9
      src/main.rs

@ -1,5 +1,5 @@
[package]
name = "mcmap"
name = "wwmap"
version = "0.1.0"
edition = "2021"

@ -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
}

@ -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);
}

Loading…
Cancel
Save