1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::net::SocketAddr;
use structopt::StructOpt;
use crate::helpers::try_parse_sock_addr;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, StructOpt)]
pub enum ConfigCommands {
#[structopt(name = "add-address")]
AddAddress(SocketAddress),
#[structopt(name = "remove-address")]
RemoveAddress(SocketAddress),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, StructOpt)]
pub struct SocketAddress {
#[structopt(parse(try_from_str = try_parse_sock_addr))]
pub address: SocketAddr,
}