noise-server/src/main.rs

36 lines
767 B
Rust
Raw Normal View History

use structopt::StructOpt;
use std::path::PathBuf;
use serde::Deserialize;
const DEFAULT_DATABASE_PATH: &'static str = "/var/lib/noise-server/noise-server.sqlite";
#[derive(Debug, StructOpt)]
struct Options {
#[structopt(short, long, default_value = "/etc/noise-server/config.toml")]
config: PathBuf,
#[structopt(short, long, default_value = DEFAULT_DATABASE_PATH)]
database_path: PathBuf,
}
#[derive(Debug, Deserialize)]
#[serde(default)]
struct Config {
database_path: PathBuf,
}
impl Default for Config {
fn default() -> Self {
Config {
database_path: DEFAULT_DATABASE_PATH.into(),
}
}
}
2021-04-06 19:42:24 +02:00
fn main() {
let options = Options::from_args();
#[cfg(debug_assertions)]
println!("{:?}", options);
2021-04-06 19:42:24 +02:00
}