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

All help-style (all, scripts, basic) commands fail #168

Closed
deadcoder0904 opened this issue Feb 18, 2018 · 10 comments
Closed

All help-style (all, scripts, basic) commands fail #168

deadcoder0904 opened this issue Feb 18, 2018 · 10 comments

Comments

@deadcoder0904
Copy link

  • nps version: 5.7.1
  • node version: 9.5.0
  • npm version: 5.6.0

Scripts file (or at least the relevant bits):

"scripts" : {
  "help": "nps help \"--help-style all\""
}

The command executed:

npm run help

The output:

> nps help "--help-style all"

You provided one or more invalid flags: help-style all, helpStyleAll Did you forget to put your command in quotes? https://github.com/kentcdodds/nps/blob/v5.7.1/other/ERRORS_AND_WARNINGS.md#invalid-flags
<my-project>/node_modules/.registry.npmjs.org/nps/5.7.1/node_modules/nps/dist/bin-utils/parser.js:106
    throw new Error(`invalid flag(s) passed: ${invalidFlags}`);
    ^

Error: invalid flag(s) passed: help-style all,helpStyleAll
    at parse (<my-project>/node_modules/.registry.npmjs.org/nps/5.7.1/node_modules/nps/dist/bin-utils/parser.js:106:11)
    at Object.<anonymous> (<my-project>/node_modules/.registry.npmjs.org/nps/5.7.1/node_modules/nps/dist/bin/nps.js:22:33)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:190:16)
    at bootstrap_node.js:662:3

Problem description:

Show help scripts with description. All help-style commands fail.

Suggested solution:

Make --help-style command work.

@deadcoder0904
Copy link
Author

Hey actually nothing works from https://github.com/kentcdodds/nps/blob/master/src/bin-utils/parser.js#L32-L62

I tried nps help "--log-level info". Is there something I am doing wrong ❓

@K3TH3R
Copy link
Collaborator

K3TH3R commented Feb 24, 2018

@kentcdodds it looks like there hasn't been a release auto-published since last August, so anything that has been merged since then hasn't been getting pushed.

@kentcdodds
Copy link
Collaborator

Thanks for letting me know @K3TH3R. I've fixed the travis config so the releases should go out, but now the build is failing. I'm unable to dedicate much time to this project at the moment, but will accept a PR from anyone who can fix the build.

@Miklet
Copy link
Collaborator

Miklet commented Feb 25, 2018

Tests failed because of timeout. @kentcdodds can we run build again manually? I pulled the newest version and all tests are passing locally and all snapshots are updated.

@edit Tried restarting but now other tests failed 🤔

@kentcdodds
Copy link
Collaborator

Ok, I ran it again and it's green 👍 No idea what's going on... Someone should probably look into this...

@Miklet
Copy link
Collaborator

Miklet commented Mar 1, 2018

I think we can close this issue, the main problem is solved and cli's tests stability improved.

@prastut
Copy link

prastut commented Apr 25, 2018

@deadcoder0904 @Miklet this still doesn't work.

screen shot 2018-04-25 at 1 30 39 pm

@iamturns
Copy link

iamturns commented Sep 4, 2018

Getting the same error as above.

@Undistraction
Copy link

Undistraction commented Dec 5, 2018

Same issue here:

Using:

nps help "--help-style scripts"

Results in:

You provided one or more invalid flags: help-style scripts, helpStyleScripts Did you forget to put your command in quotes? https://github.com/kentcdodds/nps/blob/v5.9.3/other/ERRORS_AND_WARNINGS.md#invalid-flags
/Users/me/Sites/frontend/node_modules/nps/dist/bin-utils/parser.js:112
    throw new Error(`invalid flag(s) passed: ${invalidFlags}`);
    ^

Error: invalid flag(s) passed: help-style scripts,helpStyleScripts
  • "nps": "^5.9.3",
  • "nps-utils": "^1.7.0",

@Miklet Looks like this issue needs to be reopened …

@AnthonySLWhite
Copy link

If you do it like this:

nps --help-style basic help

or like this:
nps help --help-style basic

It accepts with no errors.
But if you try it with an invalid argument like:
nps --help-style basic help

Results in:

Invalid values:
  Argument: help-style, Given: "basics", Choices: "all", "scripts", "basic"

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

No branches or pull requests

8 participants