You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
445 B
26 lines
445 B
use clap::Parser;
|
|
|
|
#[derive(Parser)]
|
|
pub struct Arguments {
|
|
/// IP address
|
|
#[arg(short, long, default_value_t = String::from("127.0.0.1"))]
|
|
pub ip: String,
|
|
/// Port to listen to
|
|
#[arg(short, long, default_value_t = 8081)]
|
|
pub port: u16,
|
|
}
|
|
|
|
impl Arguments {
|
|
|
|
pub fn parse_args() -> Arguments {
|
|
let args = Arguments::parse();
|
|
args
|
|
}
|
|
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct AppData {
|
|
pub name: String,
|
|
}
|