Skip to content

Support printing environment variables in --help #320

Open
@buremba

Description

@buremba

It would be great if we can print the environment variables for arguments when --help is enabled. Ideally, it can be configurable in CliktHelpFormatter.

Activity

ajalt

ajalt commented on Nov 2, 2021

@ajalt
Owner

Can you give me an example of the output you're asking for?

buremba

buremba commented on Nov 2, 2021

@buremba
Author

Here is how it looks like:

Usage: commands serve [OPTIONS]

  Spins up an HTTP server serving your datasets

Options:
  --profile TEXT                   Some description.

If we have PROFILE environment variable attached to the argument, maybe something like this would make sense:

Usage: commands serve [OPTIONS]

  Spins up an HTTP server serving your datasets

Options:
  --profile TEXT                   Some description.          PROFILE

or maybe this one:

Usage: commands serve [OPTIONS]

  Spins up an HTTP server serving your datasets

Options:
  --profile TEXT                   Some description.     
  PROFILE

What do you think?

ajalt

ajalt commented on Nov 3, 2021

@ajalt
Owner

Are you asking for the values of the environment variables, or the names of the variables i.e. the values you pass to envvar when creating the option?

buremba

buremba commented on Nov 3, 2021

@buremba
Author

@ajalt , not sure if I understood the question. The feature request is for printing environment variables activated via envvar when we run program --help.
If you're asking whether we should print the value of the environment variables in --help, that would be a great addition as well.

ajalt

ajalt commented on Nov 3, 2021

@ajalt
Owner

I'm not sure what you mean by activated.

If you have an option val opt by option(envvar="FOO"), are you asking for FOO to show up in the help output?

buremba

buremba commented on Nov 3, 2021

@buremba
Author

That's correct. :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Support printing environment variables in `--help` Β· Issue #320 Β· ajalt/clikt