Add --cleanexit option (#309)

* add --cleanexit option

* bump jslib
This commit is contained in:
Thomas Rittson 2021-05-26 21:16:25 +10:00 committed by GitHub
parent 7a83b30490
commit 13d3109f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

2
jslib

@ -1 +1 @@
Subproject commit 395ded02aa70211f8d334a7bd314e6c8c25e06d7
Subproject commit 25917faf9153106d7ef249f949a00b901ffbd33c

View File

@ -37,6 +37,7 @@ export class Program extends BaseProgram {
.option('--pretty', 'Format output. JSON is tabbed with two spaces.')
.option('--raw', 'Return raw output instead of a descriptive message.')
.option('--response', 'Return a JSON formatted version of response output.')
.option('--cleanexit', 'Exit with a success exit code (0) unless an error is thrown.')
.option('--quiet', 'Don\'t return anything to stdout.')
.option('--nointeraction', 'Do not prompt for interactive user input.')
.option('--session <session>', 'Pass session key instead of reading from env.')
@ -58,6 +59,10 @@ export class Program extends BaseProgram {
process.env.BW_RESPONSE = 'true';
});
program.on('option:cleanexit', () => {
process.env.BW_CLEANEXIT = 'true';
});
program.on('option:nointeraction', () => {
process.env.BW_NOINTERACTION = 'true';
});