1
0

71 lines
2.2 KiB
Rust
Raw Normal View History

use std::path::PathBuf;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "martillo-maldito", about = "A simple iptables ban server")]
pub enum Arguments {
#[structopt(about = "Initialize ban server")]
BanServer {
#[structopt(name = "Ssh auth log file", short = "f", long = "ssh-file")]
ssh_auth_log: PathBuf,
#[structopt(name = "Iptables save file", short = "s", long = "iptables-save")]
iptables_save: Option<PathBuf>,
},
#[structopt(about = "Ban port")]
BanPort {
#[structopt(name = "Port to ban", short = "p", long = "port")]
port: u16,
2024-05-28 17:31:14 +02:00
#[structopt(name = "Docker", short = "d", long = "docker")]
docker: bool,
#[structopt(name = "Position", short = "P", long = "position")]
position: Option<i32>,
},
#[structopt(about = "Unban port")]
UnbanPort {
#[structopt(name = "Port to unban", short = "p", long = "port")]
port: u16,
2024-05-28 17:31:14 +02:00
#[structopt(name = "Docker", short = "d", long = "docker")]
docker: bool,
},
#[structopt(about = "Allow ip and port")]
AllowIpPort {
#[structopt(name = "Ip to allow", short = "i", long = "ip")]
ip: String,
#[structopt(name = "Port to allow", short = "p", long = "port")]
port: u16,
2024-05-28 17:31:14 +02:00
#[structopt(name = "Docker", short = "d", long = "docker")]
docker: bool,
#[structopt(name = "Position", short = "P", long = "position")]
position: Option<i32>,
},
#[structopt(about = "Allow port for only an ip")]
OnlyIpPort {
#[structopt(name = "Ip to allow", short = "i", long = "ip")]
ip: String,
#[structopt(name = "Port to allow", short = "p", long = "port")]
port: u16,
#[structopt(name = "Docker", short = "d", long = "docker")]
docker: bool,
},
#[structopt(about = "Remove ip and port")]
RemoveIpPort {
#[structopt(name = "Ip to remove", short = "i", long = "ip")]
ip: String,
#[structopt(name = "Port to remove", short = "p", long = "port")]
port: u16,
2024-05-28 17:31:14 +02:00
#[structopt(name = "Docker", short = "d", long = "docker")]
docker: bool,
},
}