Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Ensure proper usage of yargs + npm create script with using -- #705

Conversation

mikeseese
Copy link
Contributor

@mikeseese mikeseese commented Jan 11, 2021

This PR is part of #700

See more details of why this PR is necessary in #704

This PR is option 2 (using named, non-positional args, but requiring --

--

Because of the reasons stated in #704, if you want to use non-positional/named arguments in an NPM script, you must use the -- between the npm run <script> and the first flag.

This PR essentially re-introduces the changes I originally had in #701

Comment on lines -63 to -64
"Positionals:": chalk.bold("Options"),
"Options:": ` `,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you insisted on joining these two while still having positional and non-positional arguments (from the way the script was written, despite they were all being processed as positional anyways). Regardless, if you have two separate types of arguments, they should be separated to help out developers understand what is what. By joining these, you're removing contextual help/usage information for a little extra screen space. I encourage you keep this if you choose this PR option.

@mikeseese mikeseese changed the title Ensure yargs option options are properly processed Ensure proper usage of yargs + npm create script with using -- Jan 11, 2021
@mikeseese
Copy link
Contributor Author

Closing in favor of #707

@mikeseese mikeseese closed this Jan 11, 2021
@mikeseese mikeseese deleted the fix/create-script-option-2 branch January 11, 2021 19:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant