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

Support printing environment variables in --help #320

Open
buremba opened this issue Nov 2, 2021 · 6 comments
Open

Support printing environment variables in --help #320

buremba opened this issue Nov 2, 2021 · 6 comments

Comments

@buremba
Copy link

buremba commented Nov 2, 2021

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

@ajalt
Copy link
Owner

ajalt commented Nov 2, 2021

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

@buremba
Copy link
Author

buremba commented Nov 2, 2021

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
Copy link
Owner

ajalt commented Nov 3, 2021

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
Copy link
Author

buremba commented Nov 3, 2021

@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
Copy link
Owner

ajalt commented Nov 3, 2021

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
Copy link
Author

buremba commented Nov 3, 2021

That's correct. :)

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

No branches or pull requests

2 participants