From 4359f43bb3c2100563fd5847b616e6e17ddf676e Mon Sep 17 00:00:00 2001 From: Alan Souza Date: Mon, 8 Aug 2016 11:46:38 -0700 Subject: [PATCH] Added keepAlive option. Fixed wrong place for check --- dist/vorpal.js | 6 ++++-- lib/vorpal.js | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/vorpal.js b/dist/vorpal.js index a5aafcfc..9bfaefd8 100755 --- a/dist/vorpal.js +++ b/dist/vorpal.js @@ -167,8 +167,10 @@ Vorpal.prototype.parse = function (argv, options) { this.exec(args.join(' '), function (err) { if (err !== undefined && err !== null) { throw new Error(err); - // Exits the CLI context as the UI is still attached - this.exec('exit'); + if (!options.keepAlive) { + // Exits the CLI context as the UI is still attached + this.exec('exit'); + } } }); } diff --git a/lib/vorpal.js b/lib/vorpal.js index fd8fdfa6..077b7a3a 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -167,7 +167,9 @@ Vorpal.prototype.parse = function (argv, options) { this.exec(args.join(' '), function (err) { if (err !== undefined && err !== null) { throw new Error(err); - // Exits the CLI context as the UI is still attached + } + if (!options.keepAlive) { + // Exits the CLI context as the UI is still attached this.exec('exit'); } });