arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.12k stars 65 forks source link

List of environment variables defined by command options in `--help` #150

Open Drarig29 opened 1 year ago

Drarig29 commented 1 year ago

At the end of node --help, there is a list of environment variables.

Extract:

  --watch-path=...                                                path to watch
  --zero-fill-buffers                                             automatically zero-fill all newly allocated Buffer and SlowBuffer instances

Environment variables:
FORCE_COLOR                   when set to 'true', 1, 2, 3, or an empty string causes NO_COLOR and NODE_DISABLE_COLORS to
                              be ignored.
NO_COLOR                      Alias for NODE_DISABLE_COLORS
NODE_DEBUG                    ','-separated list of core modules that should print debug information
NODE_DEBUG_NATIVE             ','-separated list of C++ core debug categories that should print debug output
...
NODE_V8_COVERAGE              directory to output v8 coverage JSON to
TZ                            specify the timezone configuration
UV_THREADPOOL_SIZE            sets the number of threads used in libuv's threadpool

Documentation can be found at https://nodejs.org/

It would be great to have something like this with clipanion. It could be shown automatically when we define an Option.String() with env.

I think having the list of environment variables at the end would avoid cluttering the existing help output.

Drarig29 commented 1 year ago

I would be happy to work on this.