You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
show_envvar=True Drops Environment Variable from Error Messages When Using auto_envvar_prefix #3914
When an option is configured with show_envvar=True and the command or context defines an auto_envvar_prefix, the help output correctly lists the derived environment variable (e.g. [env var: MYAPP_PORT]). However, if that option is omitted or has an invalid value at runtime, the error hint produced by Option.get_error_hint() omits the environment variable entirely (Error: Missing option '--port'.), whereas declaring envvar="MYAPP_PORT" explicitly outputs Error: Missing option '--port' (env var: 'MYAPP_PORT').. show_envvar is documented to show the environment variable on both the help page and in error messages. Option.get_error_hint(ctx) receives ctx, but currently only checks self.envvar and does not check ctx.auto_envvar_prefix.
When show_envvar=True is enabled and auto_envvar_prefix is set on the context, the missing parameter and bad parameter error messages should include the resolved environment variable hint:
Activity
Include auto_envvar_prefix in error hints when show_envvar is True (p…
fix(core): include auto_envvar_prefix in Option.get_error_hint (palle…
Add changelog entry for pallets#3914
docs: add changelog entry for issue pallets#3914
Fix auto envvar display in option error hints (fixes pallets#3914)
Test auto envvar in missing-option hints (fixes pallets#3914)
Document auto envvar error hint fix (fixes pallets#3914)
fix(core): include auto_envvar_prefix in Option error hint when show_…
fix(core): include auto_envvar_prefix in Option error hint when show_…
fix: show derived envvar in error hint with auto_envvar_prefix
fix(core): include auto_envvar_prefix in Option error hint when show_…