alecthomas / alecthomas/kong

Expose the source of resolved flag values

Abierto
#656 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
3.2k
Forks
188
Merge medio
1 d 1 h
PR fusionados (30 d)
2

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.