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

-h or --help do not list available scripts nor help command #180

Open
wmertens opened this issue Jun 16, 2018 · 1 comment
Open

-h or --help do not list available scripts nor help command #180

wmertens opened this issue Jun 16, 2018 · 1 comment

Comments

@wmertens
Copy link

  • nps version: 5.9.0
  • node version: 8.9.4
  • npm version: 6.1.0

Scripts file (or at least the relevant bits):

module.exports = {scripts: {
	default: 'nps dev',
[...]

The command executed:

nps -h

The output:

20000 $ nps -h
Usage: ../../../../bin/node_modules/nps/dist/bin/nps.js [options] <script>...

Commands:
  init        automatically migrate from npm scripts to nps
  completion  generate bash completion script

Options:
  --config, -c      Config file to use (defaults to nearest package-scripts.yml
                    or package-scripts.js)                             [default:
         "/path/to/my/package-scripts.js"]
  --silent, -s      Silent nps output                 [boolean] [default: false]
  --log-level, -l   The log level to use
                   [choices: "error", "warn", "info", "debug"] [default: "info"]
  --require, -r     Module to preload
  --scripts         Log command text for script        [boolean] [default: true]
  --help-style, -y  Choose the level of detail displayed by the help command
                           [choices: "all", "scripts", "basic"] [default: "all"]
  -h, --help        Show help                                          [boolean]
  -v, --version     Show version number                                [boolean]

Examples:
  ../../../../bin/node_modules/nps/dist/bi  Runs the `test` script then the
  n/nps.js test build                       `build` script
  ../../../../bin/node_modules/nps/dist/bi  Runs the `test` script and forwards
  n/nps.js "test --cover" "build --prod"    the "--cover" flag then the `build`
                                            script and forwards the "--prod"
                                            flag

Problem description:

This output does not include the section Available scripts that you get when you run nps help.

It also does not include the command help in the Commands: section, so you can't find that out without reading the documentation

Suggested solution:

-h and --help should also list available scripts. This is IMHO the least surprising UX.

@kevjin
Copy link
Collaborator

kevjin commented Mar 12, 2019

Hi @wmertens, thanks for the issue. I agree listing available scripts with -h or --help makes sense from a UX perspective, as well as having the help command in the Commands section. Would you be free to make a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants