Skip to content

Missing detection of envvars via auto_envvar_prefix-option #105

@PatrikHlobil

Description

@PatrikHlobil

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions