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
|
program
|
||||||
.version('Version ' + packageJSON.version)
|
.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', [])
|
commandWithOpenOptions('open [url]', 'open page in browser specified via -b, --browser', [])
|
||||||
.action(function(url, options) {
|
.action(function(url, options) {
|
||||||
|
|
@ -606,3 +606,16 @@ async function launchGridServer(factoryPathOrPackageName: string, port: number,
|
||||||
await gridServer.start(port);
|
await gridServer.start(port);
|
||||||
console.log('Grid server is running at ' + gridServer.urlPrefix());
|
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…
Reference in a new issue