Reject conflicting CLI operation modes

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

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

評価

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

調査の方向性

main.go のフラグ宣言とモード選択の switch から始めてください。issue から直接リンクされている箇所です。-scrape -upload -map のような競合する組み合わせで switch を確認し、実際のリクエストは実行せずに再現してください。-scrape、-parse、-upload のうち2つ以上を指定したコマンドが、処理を開始する前に分かりやすいメッセージを表示してゼロ以外の終了コードで終了すること、そして単一モードのコマンドとモード未指定時のヘルプ出力が従来どおり動作することが完了条件です。

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

説明

Description

The CLI accepts multiple operation modes (-scrape, -parse, and -upload) at once. The switch in main.go silently chooses the first matching mode instead of reporting an invalid combination.

For example, -scrape -upload -map starts scraping even though the command requests both scraping and uploading.

Expected behavior:

  • Reject any combination containing more than one operation mode with a clear message explaining that only one mode may be selected.
  • Exit with a nonzero status before starting scraping, parsing, or uploading.
  • Preserve valid single-mode commands and the existing help behavior when no mode is supplied.
Steps To Reproduce
  1. Build the executable with make build (or build.bat build on Windows).
  2. Run:
    ./api-tools -scrape -upload -map
    
  3. Observe that the CLI selects scraping instead of rejecting the conflicting modes.

The same problem applies to -scrape -parse, -parse -upload, and all three mode flags together. The example above performs a real map scrape; inspecting the mode-selection switch also demonstrates the problem without making requests.

Additional Context

Flag declarations and mode-selection switch in main.go.

Environment
主要言語
Go
スター
12
フォーク
54
平均マージ
14日 1時間
マージ済み PR(30日)
1

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

UTDNebula/api-tools のほかの issue

UTDNebula/api-tools の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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