vorpal icon indicating copy to clipboard operation
vorpal copied to clipboard

Required options do not throw error

Open toddpi314 opened this issue 8 years ago • 2 comments

Regression of https://github.com/dthree/vorpal/issues/60

Broken on 1.10.0, 1.11.0 and 1.12.0 Confirmed working on 1.9.0

toddpi314 avatar May 03 '17 17:05 toddpi314

@toddpi314 Do you have a simple example of this occurring?

milesj avatar May 25 '17 03:05 milesj

Hi, here what I ve found.

vorpal
    .command('createUser')
    .option('--email <email>', 'Email for new user. Must be unique')
    .action(function (args, callback) {
        const { email } = args;
        this.log('Success !!!', email, canAccessKeystone);
        callback();
    });

In the code above I say, that email option is required, but in console I can just write command 'createUser' and it don't throw any error. I find, that is failed when I pass option without value. For me it work a little bit strange.

vesground avatar Aug 06 '17 21:08 vesground