Skip to content

Commit 1ef3f9a

Browse files
committed
Added keepAlive option.
1 parent e296576 commit 1ef3f9a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

dist/vorpal.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ Vorpal.prototype.parse = function (argv, options) {
167167
this.exec(args.join(' '), function (err) {
168168
if (err !== undefined && err !== null) {
169169
throw new Error(err);
170-
// Exits the CLI context as the UI is still attached
171-
this.exec('exit');
170+
if (!options.keepAlive) {
171+
// Exits the CLI context as the UI is still attached
172+
this.exec('exit');
173+
}
172174
}
173175
});
174176
}

lib/vorpal.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ Vorpal.prototype.parse = function (argv, options) {
167167
this.exec(args.join(' '), function (err) {
168168
if (err !== undefined && err !== null) {
169169
throw new Error(err);
170-
// Exits the CLI context as the UI is still attached
171-
this.exec('exit');
170+
if (!options.keepAlive) {
171+
// Exits the CLI context as the UI is still attached
172+
this.exec('exit');
173+
}
172174
}
173175
});
174176
}

0 commit comments

Comments
 (0)