Add config_path command-line option
parent
d8173e61b5
commit
3293b3e7f9
|
@ -9,13 +9,18 @@ use tracing::debug;
|
|||
|
||||
#[derive (Debug, StructOpt)]
|
||||
struct Opt {
|
||||
//#[structopt (long)]
|
||||
//file_server_root: Option <PathBuf>,
|
||||
|
||||
#[structopt (long)]
|
||||
file_server_root: Option <PathBuf>,
|
||||
config_path: Option <PathBuf>,
|
||||
}
|
||||
|
||||
fn main () -> Result <(), Box <dyn Error>> {
|
||||
let opt = Opt::from_args ();
|
||||
|
||||
tracing_subscriber::fmt::init ();
|
||||
let path = PathBuf::from ("./config/ptth_server.toml");
|
||||
let path = opt.config_path.unwrap_or_else (|| PathBuf::from ("./config/ptth_server.toml"));
|
||||
let config_file: ptth::server::ConfigFile = ptth::load_toml::load (&path);
|
||||
|
||||
let mut rt = if false {
|
||||
|
|
Loading…
Reference in New Issue