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 #60

Closed eliperelman closed 8 years ago

eliperelman commented 8 years ago

I'm using Vorpal with the reduced test case below:

'use strict';

let cli = require('vorpal')();

cli
  .command('test')
  .description('reduced test case')
  .option('--required <val>', 'Should be a required value')
  .action(function(c) {
    console.log(c.options.required);
  });

cli.parse(process.argv);
node index test

This command's action should not execute using the given command, as no --required value was specified. According to the current source in lib/util.js:199, missing required options shows a message in the console along with help. This does not happen.

toddpi314 commented 7 years ago

This is broken again on 1.12.0 Broken on 1.10.0, 1.11.0 and 1.12.0

rimiti commented 7 years ago

Up for this issue. I have the same problem.