cli: flip repo command help options to use --jest-help instead
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -80,7 +80,10 @@ export function registerRepoCommand(program: Command) {
|
||||
'--since <ref>',
|
||||
'Only test packages that changed since the specified ref',
|
||||
)
|
||||
.helpOption(', --backstage-cli-help') // Let Jest handle help
|
||||
.option(
|
||||
'--jest-help',
|
||||
'Show help for Jest CLI options, which are passed through',
|
||||
)
|
||||
.description('Run tests, forwarding args to Jest, defaulting to watch mode')
|
||||
.action(lazy(() => import('./repo/test').then(m => m.command)));
|
||||
}
|
||||
|
||||
@@ -118,7 +118,9 @@ export async function command(opts: OptionValues, cmd: Command): Promise<void> {
|
||||
}
|
||||
|
||||
// This ensures that the process doesn't exit too early before stdout is flushed
|
||||
if (args.includes('--help')) {
|
||||
if (args.includes('--jest-help')) {
|
||||
removeOptionArg(args, '--jest-help');
|
||||
args.push('--help');
|
||||
(process.stdout as any)._handle.setBlocking(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user