Skip to content

Commit 3dc21d1

Browse files
author
Mykola Tryshnivskyy
committed
Added '--help' switch to display WD usage
1 parent de77b94 commit 3dc21d1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/chrome/test/webdriver/webdriver_server.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,33 @@ int RunChromeDriver() {
328328
base::WaitableEvent shutdown_event(false, false);
329329
CommandLine* cmd_line = CommandLine::ForCurrentProcess();
330330

331+
// check if --help CL argument is present
332+
if (cmd_line->HasSwitch("help")) {
333+
std::cout << "Usage: WebDriver [--OPTION=VALUE]..." << std::endl
334+
<< "Starts WebDriver server" << std::endl
335+
<< "" << std::endl
336+
<< "OPTION DEFAULT VALUE DESCRIPTION" << std::endl
337+
<< "http-threads 4 The number of threads to use for handling" << std::endl
338+
<< " HTTP requests" << std::endl
339+
<< "log-path ./webdriver.log The path to use for the ChromeDriver server" << std::endl
340+
<< " log" << std::endl
341+
<< "root ./web The path of location to serve files from" << std::endl
342+
<< "port 9517 The port that ChromeDriver listens on" << std::endl
343+
<< "silence false If true, ChromeDriver will not log anything" << std::endl
344+
<< " to stdout/stderr" << std::endl
345+
<< "verbose false If true, ChromeDriver will log lots of stuff" << std::endl
346+
<< " to stdout/stderr" << std::endl
347+
<< "url-base The URL path prefix to use for all incoming" << std::endl
348+
<< " WebDriver REST requests. A prefix and postfix" << std::endl
349+
<< " '/' will automatically be appended if not" << std::endl
350+
<< " present" << std::endl
351+
<< "config The path to config file (e.g. config.json) in" << std::endl
352+
<< " JSON format with specified WD parameters as" << std::endl
353+
<< " described above (port, root, etc.)" << std::endl;
354+
355+
return (EXIT_SUCCESS);
356+
}
357+
331358
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
332359
// set default output mode
333360
qInstallMessageHandler(normalMessageOutput);

0 commit comments

Comments
 (0)