Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing detection of envvars via auto_envvar_prefix-option #105

Closed
PatrikHlobil opened this issue Jun 10, 2022 · 1 comment
Closed

Missing detection of envvars via auto_envvar_prefix-option #105

PatrikHlobil opened this issue Jun 10, 2022 · 1 comment

Comments

@PatrikHlobil
Copy link

Dear maintainers,

I first wish to thank you for your project. I love click and the abilility to autogenerate the CLI documentation.

As you show in your documentation, sphinx-click automatically detects explicitly passed environment variables like:

@greet.command()
@click.argument('user', envvar='USER')
def hello(user):
    """Greet a user."""
    click.echo('Hello %s' % user)

There is however no support for the detection of auto-generated envvars like in:

@greet.command(context_settings={"auto_envvar_prefix": "HELLO"},)
@click.argument('user')
def hello(user):
    """Greet a user."""
    click.echo('Hello %s' % user)

which can use the environment variable HELLO_USER for passing the user argument.

I looked at your code, but I am not familiar enough with the internals of click and sphinx to easily see how I could add this feature.

Best Patrik

@stephenfin
Copy link
Member

TIL. I didn't know this was a thing but the docs prove it is. This would be a near enhancement if anyone wanted to work on this. If not, I'll find time eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants