use clap::{Arg, ArgAction, Command, Parser}; use uriparse::{URI, URIError}; #[derive(Parser, Debug)] #[clap(version = "0.0.1", about = "Provides bans to a compatible teeworlds server or proxy instance")] struct Args { #[clap(short = 't', long)] auth_token: String, #[clap(short, long, value_parser = parse_url)] bindaddrs: Vec, } fn parse_url(value: &str) -> Result { URI::try_from(value) }