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 天內回覆