dthree / vorpal

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

Validate doesn't log errors in downstream sessions #294

Open treygriffith opened 6 years ago

treygriffith commented 6 years ago

This is an issue when using vorpal in Vantage, but is, I think, fundamental an issue with vorpal itself.

Vorpal's _commandSetCallback only logs errors to local sessions, and validate returns any failed validations as errors, so if you are trying to validate commands from other sessions (like in Vantage), the command will fail, but without any logging in either the parent or downstream session.

Source

vantage
  .command('alwaysfail')
  .validate(function (args) {
    return "Nothing you do will make this command work."
  })

Example

$ vantage [PORT]
vantage~$ alwaysfail
vantage~$