alecthomas / alecthomas/kong

Expose the source of resolved flag values

オープン
#656 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
3.2k
フォーク
188
平均マージ
1日 1時間
マージ済み PR(30日)
2

説明

Add first-class value provenance so applications can determine where each effective flag value came from after parsing.

Kong can populate a flag from command-line input, an environment variable, a registered resolver such as a configuration file, or its declared default. Applications can inspect the final value, but they cannot reliably determine which source supplied it. This makes configuration diagnostics difficult when several sources participate in resolution and precedence.

Expose the winning source through the parsed context while preserving the existing resolution order and parsing behavior. Command-line aliases and negated flags should be treated as command-line input. Environment-backed values should identify the environment variable that supplied the value. Defaults should be distinguishable from values supplied by resolvers and from values that remain unset. Resolver-provided values should carry stable source information, and custom resolvers should be able to identify themselves without requiring existing resolver implementations to change.

The provenance information should work for flags on root, nested, and default commands and remain available after a successful parse. Document the new API alongside Kong’s resolver and configuration APIs.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

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

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