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

Help text on Windows refers to the tool name as "cli" although it's installed as "markdownlint" #2

Closed
DavidAnson opened this issue Jan 20, 2016 · 3 comments

Comments

@DavidAnson
Copy link
Collaborator

@DavidAnson DavidAnson commented Jan 20, 2016

This is a minor issue, but potentially confusing for novices. I'd suggest that "Usage:" should say "markdownlint" instead of "cli":

D:\T>markdownlint --help

  Usage: cli [options] <files>

  MarkdownLint Command Line Interface

  Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -c, --config [configFile]  Configuration file

As an extremely minor point, the 'O's of "Output" might be capitalized and the 'V' of "-V" lower-cased for consistency with the other switches.

@igorshubovych
Copy link
Owner

@igorshubovych igorshubovych commented Jan 20, 2016

It is interesting, I see it as correctly:
http://take.ms/ylei3

Have you installed it globally (-g)? As far as I see you are using Windows.

@DavidAnson DavidAnson changed the title Help text refers to the tool name as "cli" although it's installed as "markdownlint" Help text on Windows refers to the tool name as "cli" although it's installed as "markdownlint" Jan 21, 2016
@DavidAnson
Copy link
Collaborator Author

@DavidAnson DavidAnson commented Jan 21, 2016

Commander attempts to infer the tool name if it is not passed in - see Command.prototype.parse.

On Windows (including when installed globally), argv at that point looks like:

[ 'C:\\Program Files\\nodejs\\node.exe',
  'd:\\T\\markdownlint-cli\\cli.js' ]

Therefore, commander infers the name "cli".

One fix might be to rename cli.js to markdown.js. Another might be something like the following:

var pkg = require('./package');
var commander = require('commander');
var program = new commander.Command(pkg.name.replace(/-.*$/, ''));

If you like, I can send a pull request - or feel free to make the change yourself if you like it.

@igorshubovych
Copy link
Owner

@igorshubovych igorshubovych commented Jan 22, 2016

Thanks, @DavidAnson.

For now I just renamed it.
But I don't like it already, if i will see more issues like this, i will rewrite it using meow, argparse, minimist anything like that instead of commander.

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

2 participants