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/--help option does not output the banner #644

Closed
Xenonym opened this issue Jan 30, 2019 · 1 comment · Fixed by #946
Closed

-h/--help option does not output the banner #644

Xenonym opened this issue Jan 30, 2019 · 1 comment · Fixed by #946

Comments

@Xenonym
Copy link
Contributor

Xenonym commented Jan 30, 2019

Tell us about your environment

  • MarkBind Version: 1.17.1

What did you do? Please include the actual source code causing the issue.
I ran markbind -h/--help / markbind <option> -h/--help.

What did you expect to happen?
Like other commands, -h/--help should output with the header:

  __  __                  _      ____    _               _
 |  \/  |   __ _   _ __  | | __ | __ )  (_)  _ __     __| |
 | |\/| |  / _` | | '__| | |/ / |  _ \  | | | '_ \   / _` |
 | |  | | | (_| | | |    |   <  | |_) | | | | | | | | (_| |
 |_|  |_|  \__,_| |_|    |_|\_\ |____/  |_| |_| |_|  \__,_|

 v1.17.1
 
  Usage: markbind <command>


  Options:

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


  Commands:

    init|i [root]                      init a markbind website project
    serve|s [options] [root]           build then serve a website from a directory
    deploy|d [options]                 deploy the site to the repo's Github pages.
    build|b [options] [root] [output]  build a website

What actually happened? Please include the actual, raw output.
The help information was printed without a header:

PS C:\Users\pzy5a\Desktop\testbind> markbind -h

  Usage: index  <command>


  Options:

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


  Commands:

    init|i [root]                      init a markbind website project
    serve|s [options] [root]           build then serve a website from a directory
    deploy|d [options]                 deploy the site to the repo's Github pages.
    build|b [options] [root] [output]  build a website

This was also the case for option help eg. markbind serve -h/--help.
Also, the usage information is improperly formatted; it should be markbind <command> instead of index <command> (note the extraneous space).

@damithc damithc changed the title -h/--help option does not output header -h/--help option does not output the banner May 20, 2019
@madanalogy
Copy link
Contributor

madanalogy commented Dec 2, 2019

I have investigated the issue and have a suggested fix in #946

The current version of commander does not support custom help messages: tj/commander.js#893. However, commander v3.0 supports customisation of help messages and flags: tj/commander.js#242 (comment).

My suggested fix is to upgrade commander and make use of the helpOption() function as described in https://github.com/tj/commander.js/#automated---help.

I also fixed the usage information by setting program.name to markbind.

As I am new to node and npm however, I am unsure whether simply updating the version in package.json is sufficient to update the deployed version of commander.

Any and all comments are appreciated!

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

Successfully merging a pull request may close this issue.

2 participants