refactor: CLI P0-P2 全面改进

P0:
- 子命令重构: qrgen encode / qrgen decode
- Shell 补全: --generate-completions bash/zsh/fish/pwsh/elvish
- -v 改为 -V (version), Cli::version 继承 Cargo.toml

P1:
- stdin 管道: encode/decode 支持 - 从 stdin 读取
- 退出码: 0=成功, 1=输入错误, 2=系统错误
- 错误消息: bail! 宏 + 上下文信息

P2:
- 进度指示: batch 模式使用 indicatif 进度条
- --version 自动生成

新增依赖: clap_complete, indicatif, image (direct)
This commit is contained in:
2026-06-20 17:48:17 +08:00
parent 5fb967a353
commit e6a7efc760
3 changed files with 824 additions and 437 deletions
+3
View File
@@ -12,6 +12,9 @@ path = "src/main.rs"
[dependencies]
qr-core = { path = "../core" }
clap = { version = "4", features = ["derive"] }
clap_complete = "4"
anyhow = "1"
image = "0.25"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
indicatif = "0.17"