hidely-cli: add a --json option to `list`

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

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

評価

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

調査の方向性

crates/hidely-cli/src/main.rs から始めてください。ここには list コマンドと USAGE テキストがあります。次に crates/hidely-core/src/windows.rs の list_windows(None) と WindowInfo 型、そして excluded フラグのために display_affinity(hwnd) を読んでください。crates/hidely-cli/Cargo.toml に serde_json を追加し、list --json がイシューに示されたフィールドを持つオブジェクトをウィンドウごとに 1 つ出力するようにしてください。cargo test --workspace と cargo build --workspace が成功し、通常の list の出力が変わらず、README のコマンド一覧にそのフラグが記載されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement good first issue

hidely-cli list prints a table for people. Scripts would rather have JSON.

What to do

In crates/hidely-cli/src/main.rs, accept hidely-cli list --json and print a JSON array with one object per window:

[
  { "hwnd": "0x1a2b3c", "process": "notepad", "exe": "notepad.exe", "title": "notes.txt - Notepad", "excluded_from_capture": false }
]
  • The data is already there: list_windows(None) returns WindowInfo values (see windows.rs), and display_affinity(hwnd) says whether a window is excluded.
  • Add serde_json to crates/hidely-cli/Cargo.toml and build the output with serde_json::json!, so titles with quotes or backslashes are escaped correctly.
  • hidely-cli list without the flag must print exactly what it prints today.
  • Add the option to the USAGE text at the top of the file and to the command list in the README.

Done when

  • hidely-cli list --json prints valid JSON (try piping it into ConvertFrom-Json in PowerShell).
  • Plain hidely-cli list is unchanged.
  • cargo test --workspace and cargo build --workspace pass.
主要言語
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 を短くまとめたダイジェスト。