Allow marking options with "deprecated" help or visibility

オープン
#656 コメント 8 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
swift
領域
cli

調査の方向性

@Option のエントリポイントから始め、ヘルプでの表示可否とコマンドライン診断がどのように処理されているかを追跡します。提案された .deprecated(...) 形式によってオプションが非表示になり、置き換え先のオプションをユーザーに案内する警告が stderr に出力されれば完了です。

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

説明

enhancement

Let's say my CLI tool has an old option that's no longer valid:

@Option
public var sendToCzechslovakia = false

Since Czechoslovakia doesn't exist anymore, I've replace it with sendToEuropeanUnion, and I want to inform folks still using it to change their command-line incantations. Wouldn't it be nice if I could write:

@Option(help: .deprecated("Use --send-to-european-union instead"))
public var sendToCzechslovakia = false

And have it automatically be hidden and emit some sort of diagnostic message to stderr?

⚠️ --send-to-czechoslovakia is deprecated: use --send-to-european-union instead
主要言語
Swift
スター
3.8k
フォーク
436
平均マージ
4日 11時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

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

apple/swift-argument-parser のほかの issue

apple/swift-argument-parser の issue をすべて見る

似ている issue

Swift の issue をもっと見る

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

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