feat(cli): 优化 log 子命令并引入 LogLevel 强类型解析,重构 commands.lua 注册表解析与校验逻辑

- 调整 LogLevel 的 FromStr 错误类型为 String,适配 clap 的 value_parser
- log 子命令直接绑定 LogLevel 枚举,消除硬编码校验与类型转换
- 规范化日志级别更新与配置读取逻辑
- handler 类型有 Function 改为 String
This commit is contained in:
2026-09-04 20:20:22 +08:00
parent 0c478ae39d
commit 941558cb92
29 changed files with 2238 additions and 47 deletions

View File

@@ -1,16 +1,21 @@
[package]
name = "mirror"
[workspace]
resolver = "2"
members = [
"mirror-core", "mirror-cli",
"mirror-shim",
]
#[package]
#name = "mirror"
[workspace.package]
version = "0.1.0"
edition = "2024"
rust-version = "1.94"
license = "MIT OR Unlicense"
description = "A fast, safe Rust shim launcher for Scoop"
[profile.release]
opt-level = "z"
panic = "abort"
[dependencies]
[workspace.dependencies]
anyhow = "1.0.104"
mlua = { version = "0.12.0", features = ["lua54", "vendored","send"] }
@@ -35,7 +40,3 @@ tinyjson="2.5.1"
#toml = "1.1.4+spec-1.1.0"
[features]
default = []
args=[]