pict-rs/src/config.rs
2020-06-06 19:54:06 -05:00

25 lines
528 B
Rust

use std::{net::SocketAddr, path::PathBuf};
#[derive(structopt::StructOpt)]
pub struct Config {
#[structopt(
short,
long,
help = "The address and port the server binds to, e.g. 127.0.0.1:80"
)]
addr: SocketAddr,
#[structopt(short, long, help = "The path to the data directory, e.g. data/")]
path: PathBuf,
}
impl Config {
pub(crate) fn bind_address(&self) -> SocketAddr {
self.addr
}
pub(crate) fn data_dir(&self) -> PathBuf {
self.path.clone()
}
}