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

Add longopts #97

Open
mmkal opened this issue Sep 18, 2023 · 1 comment · May be fixed by #98
Open

Add longopts #97

mmkal opened this issue Sep 18, 2023 · 1 comment · May be fixed by #98

Comments

@mmkal
Copy link

mmkal commented Sep 18, 2023

Hi - I like this library a lot, one small request. In build-scripts/any code or documentation that's checked in to source control, our team have a loose convention to always use long options (e.g. --option) rather than short options (e.g. -o) for CLI programs. The idea is that short options are helpful when you're typing and want to move fast, but they're worse if you're reading commands, (say, in an npm script), because they're harder for a newcomer or a code-reviewer to look at and guess what the option does.

So, I think it'd be worthwhile to add long options for these specific options:

  -e <path>           parses the file <path> as a `.env` file and adds the variables to the environment
  -e <path>           multiple -e flags are allowed
  -v <name>=<value>   put variable <name> into environment using value <value>
  -v <name>=<value>   multiple -v flags are allowed
  -p <variable>       print value of <variable> to the console. If you specify this, you do not have to specify a `command`
  -c [environment]    support cascading env variables from `.env`, `.env.<environment>`, `.env.local`, `.env.<environment>.local` files

I'd suggest:

  • -e -> --env
  • -v -> --variable
  • -p -> --print
  • -c -> --config
@entropitor
Copy link
Owner

Makes sense! Feel free to create a PR. It seems we already have support for this https://github.com/entropitor/dotenv-cli/blob/master/cli.js#L32

@mmkal mmkal linked a pull request Sep 19, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants