hidely-cli: add --help and --version
まだ誰も着手していません。
評価
調査の方向性
引数の処理は crates/hidely-cli/src/main.rs の main() にあり、USAGE のテキストもそこで定義されています。現在のコードがどのようにコマンドを照合し、どこで終了コード 2 で終了しているかを読んでから、help、--help、-h、--version、-V の分岐を追加してください。これら4つが終了コード 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分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信