dthree / vorpal

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

Required options do not throw error #228

Open toddpi314 opened 7 years ago

toddpi314 commented 7 years ago

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

milesj commented 7 years ago

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

vesground commented 7 years ago

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.