Skip to content

Add longopts #97

Description

@mmkal

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

Activity

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