♻️ refactor inject CLI args instead of reading them in main
parent
0b10737403
commit
30f8bbb0aa
|
@ -4,5 +4,7 @@
|
||||||
async fn main () -> anyhow::Result <()> {
|
async fn main () -> anyhow::Result <()> {
|
||||||
tracing_subscriber::fmt::init ();
|
tracing_subscriber::fmt::init ();
|
||||||
|
|
||||||
ptth_server::executable::main ().await
|
let args = std::env::args_os ();
|
||||||
|
|
||||||
|
ptth_server::executable::main (args).await
|
||||||
}
|
}
|
||||||
|
|
|
@ -490,8 +490,8 @@ pub mod executable {
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub async fn main () -> anyhow::Result <()> {
|
pub async fn main (args: std::env::ArgsOs) -> anyhow::Result <()> {
|
||||||
let opt = Opt::from_args ();
|
let opt = Opt::from_iter (args);
|
||||||
let asset_root = opt.asset_root;
|
let asset_root = opt.asset_root;
|
||||||
|
|
||||||
let path = opt.config_path.clone ().unwrap_or_else (|| PathBuf::from ("./config/ptth_server.toml"));
|
let path = opt.config_path.clone ().unwrap_or_else (|| PathBuf::from ("./config/ptth_server.toml"));
|
||||||
|
|
Loading…
Reference in New Issue