Skip to content

Commit

Permalink
使用 clap 处理命令行
Browse files Browse the repository at this point in the history
  • Loading branch information
shenghui0779 committed Dec 5, 2023
1 parent 03b9208 commit 55f62bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use tracing_appender::non_blocking::WorkerGuard;
use crate::util::AppState;

pub async fn init(cfg_file: &String) -> (AppState, WorkerGuard) {
let path = fs::canonicalize(cfg_file).unwrap_or_else(|e| panic!("配置文件加载失败:{}", e));
let path = fs::canonicalize(cfg_file)
.unwrap_or_else(|e| panic!("配置文件加载失败:{} - {}", e, cfg_file));

let cfg = Config::builder()
.add_source(config::File::with_name(path.to_str().unwrap()))
Expand Down

0 comments on commit 55f62bf

Please sign in to comment.