From d3cdc2dbed268605c637969b76e2233050e78e27 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Wed, 21 Sep 2016 23:41:26 +0100 Subject: [PATCH] geckodriver: Merge pull request #235 from andreastt/webdriver-port-alias Add --webdriver-port argument back as a hidden alias Source-Repo: https://github.com/mozilla/geckodriver Source-Revision: 72c4a05273dbc898cd07643265b933ff61cee04b --HG-- extra : rebase_source : 919b903294473889cac09b4ac91e95a2507d2abc --- testing/geckodriver/CHANGES.md | 1 + testing/geckodriver/src/main.rs | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/testing/geckodriver/CHANGES.md b/testing/geckodriver/CHANGES.md index 2f6f51e63a7b..d1780f109108 100644 --- a/testing/geckodriver/CHANGES.md +++ b/testing/geckodriver/CHANGES.md @@ -11,6 +11,7 @@ All notable changes to this program is documented in this file. - The `binary`, `args`, and `profile` entries on this dictionary is equivalent to the old `firefox_binary`, `firefox_args`, and `firefox_profile` capabilities, which have now all been removed - The `log` capability takes a dictionary such as `{log: "trace"}` to enable trace level verbosity in Gecko - The `prefs` capability lets you define Firefox preferences through capabilities +- Re-introduced the `--webdriver-port` argument as a hidden alias to `--port` ### Changed - `firefox_binary`, `firefox_args`, and `firefox_profile` capabilities removed in favour of the `firefoxOptions` dictionary detailed above and in the README diff --git a/testing/geckodriver/src/main.rs b/testing/geckodriver/src/main.rs index 0d51518d32d7..088e250dfe11 100644 --- a/testing/geckodriver/src/main.rs +++ b/testing/geckodriver/src/main.rs @@ -88,12 +88,17 @@ fn app<'a, 'b>() -> App<'a, 'b> { .value_name("HOST") .help("Host ip to use for WebDriver server (default: 127.0.0.1)") .takes_value(true)) + .arg(Arg::with_name("webdriver_port_alias") + .long("--webdriver-port") + .takes_value(true) + .hidden(true)) .arg(Arg::with_name("webdriver_port") .short("p") .long("port") .value_name("PORT") .help("Port to use for WebDriver server (default: 4444)") - .takes_value(true)) + .takes_value(true) + .conflicts_with("webdriver_port_alias")) .arg(Arg::with_name("binary") .short("b") .long("binary") @@ -141,7 +146,9 @@ You can obtain a copy of the license at https://mozilla.org/MPL/2.0/."); } let host = matches.value_of("webdriver_host").unwrap_or("127.0.0.1"); - let port = match u16::from_str(matches.value_of("webdriver_port").unwrap_or("4444")) { + let port = match u16::from_str(matches.value_of("webdriver_port") + .or(matches.value_of("webdriver_port_alias")) + .unwrap_or("4444")) { Ok(x) => x, Err(_) => return Err((ExitCode::Usage, "invalid WebDriver port".to_owned())), };