Skip to content

feat: forward cli args#233

Open
OBannon37 wants to merge 2 commits intosezna:masterfrom
OBannon37:master
Open

feat: forward cli args#233
OBannon37 wants to merge 2 commits intosezna:masterfrom
OBannon37:master

Conversation

@OBannon37
Copy link
Copy Markdown

What:
Follows the format specified in #139 to forward command line arguments to scripts. Notably, this disables running scripts in parallel from the command line.

Why:
See discussion in #139

How:
By changing the parsing of command line args in src/bin/nps.js.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

I'd like to confirm the approach here. Specifically, I'm not sure if we should also be considering programatic use here. I thought no: I left the implementation of runPackageScript as is, so folks can still run scripts in parallel from the function call if they'd like to. I am assuming if someone is calling that function, they can already pass arbitrary command line args to each command just with string concatenation after a space, which is not possible from the CLI using the previous yargs parsing.

This would be a breaking change if released.

If the approach looks good, I can add documentation.

Comment thread src/bin/nps.js
logLevel: argv.logLevel,
prefix: argv.prefix,
scripts: argv.scripts,
args: postCommandFlags,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

another alternative to this new flag would be to just concatenate all the args as space separated strings to argv._[0].

It would be the same functionality either way, since we can run a maximum of one script from the cli now.

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 this pull request may close these issues.

1 participant