dthree / vorpal

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

Added ability to cancel commands with CTRL + C #62

Closed jackyjieliu closed 8 years ago

jackyjieliu commented 8 years ago

CTRL + C will cancel a running command (if any running) by calling the cancel function registered and the cancel function on the promise if it exists

45

scotthovestadt commented 8 years ago

Looks like the test is failing on older versions of node because we can't use const widely yet without Babel or other compilers.

jackyjieliu commented 8 years ago

Didn't realize i was using const. Thanks for catching it

scotthovestadt commented 8 years ago

This looks great! Thanks.

scotthovestadt commented 8 years ago

@jackyjieliu See comments in the commit.

scotthovestadt commented 8 years ago

As discussed, the Vorpal action should be able to use this.cancel() internally to cancel itself. This should also emit the event.