mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: fix CLI --help when used in driver (#10412)
This commit is contained in:
parent
25156f4608
commit
14471fd79f
@ -40,7 +40,7 @@ const packageJSON = require('../../package.json');
|
||||
|
||||
program
|
||||
.version('Version ' + packageJSON.version)
|
||||
.name(process.env.PW_CLI_NAME || 'npx playwright');
|
||||
.name(buildBasePlaywrightCLICommand(process.env.PW_CLI_TARGET_LANG));
|
||||
|
||||
commandWithOpenOptions('open [url]', 'open page in browser specified via -b, --browser', [])
|
||||
.action(function(url, options) {
|
||||
@ -606,3 +606,16 @@ async function launchGridServer(factoryPathOrPackageName: string, port: number,
|
||||
await gridServer.start(port);
|
||||
console.log('Grid server is running at ' + gridServer.urlPrefix());
|
||||
}
|
||||
|
||||
function buildBasePlaywrightCLICommand(cliTargetLang: string | undefined): string {
|
||||
switch (cliTargetLang) {
|
||||
case 'python':
|
||||
return `playwright`;
|
||||
case 'java':
|
||||
return `mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="...options.."`;
|
||||
case 'csharp':
|
||||
return `playwright`;
|
||||
default:
|
||||
return `npx playwright`;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user