Skip to content

Commit

Permalink
fix: Prevent the first call to yargs from responding to --help
Browse files Browse the repository at this point in the history
The second call to yargs should be responsible for printing the main usage
message. This also fixes the `--help` description w/i the usage message,
which was only using the yargs default description.
claytonrcarter committed May 5, 2022
1 parent 0ae715d commit 98ab593
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/main-process/main.js
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ Node : ${process.versions.node}`;
const args = yargs(process.argv)
.alias('v', 'version')
.version(version)
.help(false)
.alias('d', 'dev')
.alias('t', 'test')
.alias('r', 'resource-path').argv;
10 changes: 1 addition & 9 deletions src/main-process/parse-command-line.js
Original file line number Diff line number Diff line change
@@ -57,10 +57,7 @@ module.exports = function parseCommandLine(processArgs) {
.alias('f', 'foreground')
.boolean('f')
.describe('f', 'Keep the main process in the foreground.');
options
.alias('h', 'help')
.boolean('h')
.describe('h', 'Print this usage message.');
options.help('help', 'Print this usage message.').alias('h', 'help');
options
.alias('l', 'log-file')
.string('l')
@@ -148,11 +145,6 @@ module.exports = function parseCommandLine(processArgs) {
};
}

if (args.help) {
process.stdout.write(options.help());
process.exit(0);
}

const addToLastWindow = args['add'];
const safeMode = args['safe'];
const benchmark = args['benchmark'];

0 comments on commit 98ab593

Please sign in to comment.