use structopt::StructOpt; #[derive(Debug, StructOpt)] #[structopt(name = "martillo_maldito", about = "A IPTables wrapper")] pub enum Cli { #[structopt(about = "Get all banned ips")] GetBannedIps { #[structopt(name = "Docker", short = "d", long = "docker")] docker: bool, }, #[structopt(about = "Get all secured ports")] GetSecuredPorts { #[structopt(name = "Docker", short = "d", long = "docker")] docker: bool, }, #[structopt(about = "Get all secured ports with allowed ips")] GetSecuredPortsWithAllowedIps { #[structopt(name = "Docker", short = "d", long = "docker")] docker: bool, }, #[structopt(about = "Check if a port is secured")] IsPortSecured { #[structopt(name = "Port to check", short = "p", long = "port")] port: u16, #[structopt(name = "Docker", short = "d", long = "docker")] docker: bool, }, #[structopt(about = "Secure a port")] SecurePort { #[structopt(name = "Port to ban", short = "p", long = "port")] port: u16, #[structopt(name = "Position", short = "P", long = "position")] position: Option, #[structopt(name = "Docker", short = "d", long = "docker")] docker: bool, }, #[structopt(about = "Unsecure a port")] UnsecurePort { #[structopt(name = "Port to unban", short = "p", long = "port")] port: u16, #[structopt(name = "Docker", short = "d", long = "docker")] docker: bool, }, #[structopt(about = "Allow an IP for a port")] AllowIpForPort { #[structopt(name = "IP to allow", short = "i", long = "ip")] ip: String, #[structopt(name = "Port to allow", short = "p", long = "port")] port: u16, #[structopt(name = "Position", short = "P", long = "position")] position: Option, #[structopt(name = "Docker", short = "d", long = "docker")] docker: bool, }, #[structopt(about = "Removes an allowance IP for a port")] RemoveAllowIpPort { #[structopt(name = "IP to remove", short = "i", long = "ip")] ip: String, #[structopt(name = "Port to remove", short = "p", long = "port")] port: u16, #[structopt(name = "Docker", short = "d", long = "docker")] docker: bool, }, #[structopt(about = "Saves the rules")] SaveRules, }