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

Standardize help output #852

Closed
4 tasks done
jaredpetersen opened this issue Aug 29, 2018 · 5 comments · Fixed by #853
Closed
4 tasks done

Standardize help output #852

jaredpetersen opened this issue Aug 29, 2018 · 5 comments · Fixed by #853

Comments

@jaredpetersen
Copy link
Contributor

jaredpetersen commented Aug 29, 2018

The standard for command line interface help outputs is to print the help message without any newlines before or after the message. Currently, Commander does both.

Commander should better adhere to the standards set by other command line interfaces like node, git, bash, grep, etc.

Changes Needed

  • Remove newline before help output
  • Remove newline after help output
  • Update documentation (particularly the "Custom help" section)
  • Update help output tests

Related to #832.

@jaredpetersen
Copy link
Contributor Author

Working on this on my fork.

@jaredpetersen
Copy link
Contributor Author

@vanesyan @abetomo @mojavelinux What are your thoughts on un-indenting the help output as well?

No Indentation (Proposed)

$ ./cli.js
Usage: my-app [options] [command]

Options:

  -v, --version    output the version number
  -h, --help       output usage information

Commands:

  start [options]  start the app
$ 

Indentation (Current)

$ ./cli.js
  Usage: my-app [options] [command]

  Options:

    -v, --version    output the version number
    -h, --help       output usage information

  Commands:

    start [options]  start the app
$ 

@jaredpetersen
Copy link
Contributor Author

jaredpetersen commented Aug 29, 2018

No indentation seems to be more standard across CLI tools. Going to implement this as part of my PR.

@jaredpetersen jaredpetersen changed the title Remove newline before and after help output Standardize help output Aug 29, 2018
@michael-brade
Copy link

This is great, thank you! Now only the error messages are still wrapped in newlines. This should be fixed as well, so I'll open a new issue.

@mojavelinux
Copy link
Contributor

What are your thoughts on un-indenting the help output as well?

I'm strongly in favor. In fact, I use a patch on top of commander.js to do exactly that.

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 a pull request may close this issue.

3 participants