[FEATURE] Add support for allow_from_autoenv in CLI arguments #1574
Unanswered
frederikaalund
asked this question in
Questions
Replies: 1 comment
-
|
I didn't read your request carefully enough at first, and assumed it wasn't possible to use Click's autoenv at all in Typer. I'd also like to be able to enable autoenv for arguments, but for any other googlers like me, here's how you can use autoenv with options at least. app = typer.Typer(add_completion=False)
@app.command(context_settings={ 'auto_envvar_prefix': 'TEST' })
def main(hello = typer.Option('world')):
print(hello)
app()Results in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently,
allow_from_autoenvis not supported for CLI arguments. I'd like to see that support added.I guess that we also need to add
auto_envvar_prefixto theTyperconstructor for it to make sense.Ideally, I'd like to have a global option (
Typerconstructor argument) that simply enables the autoenv functionality for allTyper.Optioninstances. I guess that is a separate feature request.Beta Was this translation helpful? Give feedback.
All reactions