Git Grep's tokens that look like environment variables (UPPER_UPPER) out of the current code base underneath the given dir or \$PWD
Useful to find out environment variables supported in a code base when they're not well documented
Won't find short one-piece environment variables like DEBUG because otherwise we'd also return HTTPS and all sorts of other irrelevant tokens and noise.
Originally written to document ArgoCD's environment variables for better administration
https://github.com/argoproj/argo-cd/pull/8680
Files or extensions to exclude can optionally be specified as args, and must be valid ERE regex that match the file path suffix, filenames and file extention literals will usually be fine
Examples:
You may want to exclude other files like Dockerfiles, Makefiles to just focus on environment variables supported in the actual code.
You can mix and match any of the following argument examples.
Exclude Dockerfiles and Makefiles:
${0##*/} Dockerfile Makefile
To exclude all Dockerfiles like Dockerfile and Dockerfile.dev, Dockerfile.prod etc. this ERE regex must be quoted to not expand in the shell before being passed to this script: