feat(cli): 优化 log 子命令并引入 LogLevel 强类型解析,重构 commands.lua 注册表解析与校验逻辑
- 调整 LogLevel 的 FromStr 错误类型为 String,适配 clap 的 value_parser - log 子命令直接绑定 LogLevel 枚举,消除硬编码校验与类型转换 - 规范化日志级别更新与配置读取逻辑 - handler 类型有 Function 改为 String
This commit is contained in:
18
mirror-cli/Cargo.toml
Normal file
18
mirror-cli/Cargo.toml
Normal file
@@ -0,0 +1,18 @@
|
||||
[package]
|
||||
name = "mirror-cli"
|
||||
version = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
|
||||
# 显式指定生成的二进制文件名
|
||||
[[bin]]
|
||||
name = "mr"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
mirror-core = { path = "../mirror-core" }
|
||||
clap = { version = "4.6.6", features = ["cargo", "color", "derive","string"] }
|
||||
clap_derive = { version = "4.6.4" }
|
||||
mlua = { workspace = true }
|
||||
anyhow = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = { workspace = true }
|
||||
Reference in New Issue
Block a user