dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

Align error-message in code with the documentation #73

Closed aus70 closed 8 years ago

aus70 commented 8 years ago

An error message related to the correct command argument sequence does not reflect the documentation: "Put the required arguments first, and variadic in the back.". (See also gitter chat on Dec 29, 2015, 18:36 CET).

Thanks!

dthree commented 8 years ago

That Gitter chat is going to get lost very soon:


Alessando:

Hi! I just started playing around with Vorpal and I have a question. I tried the very first demo command: vorpal .command('foo [optionalArg]') .option('-v, --verbose', 'Print foobar instead.') ... the help says: Usage: foo2 [options] [optionalArg] but the option must follow the required argument, it cannot precede it am I missing anything or is the help wrong? thanks! here is the error message:

myapp$ foo --verbose abc

  Missing required argument. Showing Help:

this issue also affects the result of appending '--help': foo --help displays an error message instead of the help, because the required argument is missing


DC:

Hey there. The docs say to do required first:

Multiple arguments

Put the required arguments first, and variadic in the back.

So that's a bug in the code that the help shows the reverse. Could you file an issue for me? Thanks!

https://github.com/dthree/vorpal/wiki/api-|-vorpal.command#multiple-arguments

dthree commented 8 years ago

Fixed.