hidely-cli: add --help and --version
还没有人认领这个 Issue。
评估
调研方向
参数处理逻辑位于 crates/hidely-cli/src/main.rs 中的 main(),USAGE 文本也在该文件中定义。请阅读当前代码如何匹配命令以及在哪里以退出码 2 退出,然后为 help、--help、-h、--version 和 -V 添加分支。完成的标准是:这四个参数输出到 stdout 并以退出码 0 结束,版本号来自 env!("CARGO_PKG_VERSION"),USAGE 列出两个标志,未知命令仍以退出码 2 退出,并且 README 的 CLI 部分提到 --help 和 --version。
由索引模型根据 Issue 内容生成。
描述
hidely-cli prints its usage only when it doesn't understand the command, and then exits with code 2, as an error. Asking for help on purpose shouldn't look like a mistake, and there's no way to see which version you have.
This is a good first Rust contribution: one file, no Windows API knowledge needed.
What to do
In main() in crates/hidely-cli/src/main.rs:
hidely-cli help,hidely-cli --helpandhidely-cli -hprintUSAGEto stdout and exit withExitCode::SUCCESS.hidely-cli --versionandhidely-cli -Vprinthidely-cli 0.3.1, taking the number fromenv!("CARGO_PKG_VERSION")so it never has to be updated by hand.- Add both to the
USAGEtext. - Running it with no arguments, or with a command it doesn't know, keeps the current behaviour (usage on stderr, exit code 2).
Done when
- The four cases above behave as described.
- The CLI section of the README mentions
--helpand--version.
- 主要语言
- Rust
- 星标
- 7
- 派生
- 1
- 平均合并
- 6 小时 34 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CodingRule/Hidely 的其他 Issue
-
accessibility help wanted
难度 2/5 1-3 小时 新手友好度 72/100
CodingRule/Hidely#15 ·
-
compatibility help wanted testing
难度 2/5 1-3 小时 新手友好度 72/100
CodingRule/Hidely#14 ·
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
CodingRule/Hidely#12 ·
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
CodingRule/Hidely#3 ·
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
CodingRule/Hidely#2 ·
查看 CodingRule/Hidely 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
autofixer: follow-up
难度 2/5 1-3 小时 新手友好度 78/100
tursodatabase/turso#12531 ·
维护者通常 1 天内回复
-
bug help wanted ui
难度 2/5 1-3 小时 新手友好度 82/100
userFRM/egui-charts#4292 ·
维护者通常 1 天内回复
-
Issue-Bug Need-Review
难度 1/5 1-3 小时 新手友好度 85/100
PowerShell/DSC#1832 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复