First Check
Commit to Help
Example Code
import typer
cli = typer.Typer()
@cli.command()
def configure(file: str = typer.Argument("", envvar="FILE")):
print("Configure could be written more succintly if envvar=FILE is created by convention")
Description
We usually define arguments and options as environment variables. We tipically use a simple convention where param becomes PARAM and some_param becomes SOME_PARAM. That adds a bit of boilerplate to method definitions. I would like typer to accept environment variables that match argument and options names by conventions.
I can try to make a pull request if you find this behavior reasonable.
Wanted Solution
I would like that if envvar is not fullfilled in typer, it tries to get that environment variable by convention.
I could try to make a pull request with this idea if you find it reasonable.
Wanted Code
import typer
cli = typer.Typer()
@cli.command()
def configure(file: str)):
print("Configure accepts FILE as envvar")
Alternatives
No response
Operating System
Linux
Operating System Details
No response
Typer Version
0.7.0
Python Version
Python 3.8.10
Additional Context
No response
First Check
Commit to Help
Example Code
Description
We usually define arguments and options as environment variables. We tipically use a simple convention where
parambecomesPARAMandsome_parambecomesSOME_PARAM. That adds a bit of boilerplate to method definitions. I would liketyperto accept environment variables that match argument and options names by conventions.I can try to make a pull request if you find this behavior reasonable.
Wanted Solution
I would like that if
envvaris not fullfilled intyper, it tries to get that environment variable by convention.I could try to make a pull request with this idea if you find it reasonable.
Wanted Code
Alternatives
No response
Operating System
Linux
Operating System Details
No response
Typer Version
0.7.0
Python Version
Python 3.8.10
Additional Context
No response