@@ -167,18 +167,18 @@ export async function meowWithSubcommands(
167
167
168
168
// This is basically a dry-run parse of cli args and flags. We use this to
169
169
// determine config overrides and expected o mode.
170
- const cli1 = meow ( `` , {
170
+ const cli1 = meow ( {
171
171
argv,
172
172
importMeta,
173
173
...additionalOptions ,
174
174
flags,
175
- // Do not strictly check for flags here .
175
+ // Ensure we don't check unknown flags.
176
176
allowUnknownFlags : true ,
177
- booleanDefault : undefined , // We want to detect whether a bool flag is given at all.
178
- // We will emit help when we're ready
179
- // Plus, if we allow this then meow() can just exit here.
177
+ // Prevent meow from potentially exiting early.
180
178
autoHelp : false ,
181
179
autoVersion : false ,
180
+ // We want to detect whether a bool flag is given at all.
181
+ booleanDefault : undefined ,
182
182
} )
183
183
184
184
const orgFlag = String ( cli1 . flags [ 'org' ] || '' ) || undefined
@@ -402,7 +402,7 @@ ${isRootCommand ? ` $ ${name} scan create --json` : ''}${isRootCommand ? `\
402
402
// Do not strictly check for flags here.
403
403
allowUnknownFlags : true ,
404
404
// We will emit help when we're ready.
405
- // Plus, if we allow this then meow() can just exit here.
405
+ // Plus, if we allow this then meow may exit here.
406
406
autoHelp : false ,
407
407
autoVersion : false ,
408
408
// We want to detect whether a bool flag is given at all.
@@ -448,9 +448,11 @@ export function meowOrExit({
448
448
// This exits if .printHelp() is called either by meow itself or by us.
449
449
const cli = meow ( {
450
450
argv,
451
- autoHelp : false , // meow will exit(0) before printing the banner.
451
+ // Prevent meow from potentially exiting early.
452
+ autoHelp : false ,
452
453
autoVersion : false ,
453
- booleanDefault : undefined , // We want to detect whether a bool flag is given at all.
454
+ // We want to detect whether a bool flag is given at all.
455
+ booleanDefault : undefined ,
454
456
collectUnknownFlags : true ,
455
457
description : config . description ,
456
458
flags : config . flags ,
@@ -472,6 +474,7 @@ export function meowOrExit({
472
474
// meow({
473
475
// argv,
474
476
// allowUnknownFlags: false,
477
+ // // Prevent meow from potentially exiting early.
475
478
// autoHelp: false,
476
479
// autoVersion: false,
477
480
// description: config.description,
@@ -503,6 +506,7 @@ export function meowOrExit({
503
506
// As per https://github.com/sindresorhus/meow/issues/178
504
507
// Setting `allowUnknownFlags: false` makes it reject camel cased flags.
505
508
allowUnknownFlags : Boolean ( allowUnknownFlags ) ,
509
+ // Prevent meow from potentially exiting early.
506
510
autoHelp : false ,
507
511
autoVersion : false ,
508
512
description : config . description ,
0 commit comments