hidely-cli: add --help and --version

オープン 初心者向け
#13 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust, tauri
領域
cli

調査の方向性

引数の処理は 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 の本文から書いたものです。

説明

enhancement good first 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 --help and hidely-cli -h print USAGE to stdout and exit with ExitCode::SUCCESS.
  • hidely-cli --version and hidely-cli -V print hidely-cli 0.3.1, taking the number from env!("CARGO_PKG_VERSION") so it never has to be updated by hand.
  • Add both to the USAGE text.
  • 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 --help and --version.
主要言語
Rust
スター
7
フォーク
1
平均マージ
6時間 34分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CodingRule/Hidely のほかの issue

CodingRule/Hidely の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。