Skip to content

Commit 4548ce8

Browse files
bonigarciadiemol
andauthored
[rust] Remove short flags in selenium-manager (#11882)
Co-authored-by: Diego Molina <[email protected]>
1 parent c01a5f7 commit 4548ce8

File tree

2 files changed

+44
-42
lines changed

2 files changed

+44
-42
lines changed

rust/README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,38 @@ Selenium Manager is a CLI tool that automatically manages the browser/driver inf
2121
2222
Usage: selenium-manager [OPTIONS]
2323
Options:
24-
-b, --browser <BROWSER>
24+
--browser <BROWSER>
2525
Browser name (chrome, firefox, edge, iexplorer, safari, or safaritp)
26-
-d, --driver <DRIVER>
26+
--driver <DRIVER>
2727
Driver name (chromedriver, geckodriver, msedgedriver, IEDriverServer, or safaridriver)
28-
-v, --driver-version <DRIVER_VERSION>
28+
--driver-version <DRIVER_VERSION>
2929
Driver version (e.g., 106.0.5249.61, 0.31.0, etc.)
30-
-B, --browser-version <BROWSER_VERSION>
30+
--browser-version <BROWSER_VERSION>
3131
Major browser version (e.g., 105, 106, etc. Also: beta, dev, canary -or nightly- is accepted)
32-
-P, --browser-path <BROWSER_PATH>
32+
--browser-path <BROWSER_PATH>
3333
Browser path (absolute) for browser version detection (e.g., /usr/bin/google-chrome, "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome", "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe")
34-
-p, --proxy <PROXY>
34+
--output <OUTPUT>
35+
Output type: LOGGER (using INFO, WARN, etc.), JSON (custom JSON notation), or SHELL (Unix-like) [default: LOGGER]
36+
--proxy <PROXY>
3537
HTTP proxy for network connection (e.g., https://myproxy.net:8080)
36-
-t, --timeout <TIMEOUT>
38+
--timeout <TIMEOUT>
3739
Timeout for network requests (in seconds) [default: 120]
38-
-D, --debug
40+
--driver-ttl <DRIVER_TTL>
41+
Driver TTL (time-to-live) [default: 86400]
42+
--browser-ttl <BROWSER_TTL>
43+
Browser TTL (time-to-live) [default: 0]
44+
--clear-cache
45+
Clear cache folder (~/.cache/selenium)
46+
--clear-metadata
47+
Clear metadata file (~/.cache/selenium/selenium-manager.json)
48+
--debug
3949
Display DEBUG messages
40-
-T, --trace
50+
--trace
4151
Display TRACE messages
42-
-c, --clear-cache
43-
Clear driver cache
4452
-h, --help
45-
Print help information
53+
Print help
4654
-V, --version
47-
Print version information
48-
--driver-ttl <TTL IN SECONDS>
49-
Set custom TTL for driver in seconds. Default value is 86400
50-
--browser-ttl <TTL IN SECONDS>
51-
Set custom TTL for browser in seconds default value is 0
52-
--clear-metadata
53-
Delete metadata file if it exists
55+
Print version
5456
```
5557

5658
For instance, the command required to manage chromedriver is the following:

rust/src/main.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,62 +42,62 @@ use selenium_manager::metadata::clear_metadata;
4242
{all-args}")]
4343
struct Cli {
4444
/// Browser name (chrome, firefox, edge, iexplorer, safari, or safaritp)
45-
#[clap(short, long, value_parser)]
45+
#[clap(long, value_parser)]
4646
browser: Option<String>,
4747

4848
/// Driver name (chromedriver, geckodriver, msedgedriver, IEDriverServer, or safaridriver)
49-
#[clap(short, long, value_parser)]
49+
#[clap(long, value_parser)]
5050
driver: Option<String>,
5151

5252
/// Driver version (e.g., 106.0.5249.61, 0.31.0, etc.)
53-
#[clap(short = 'v', long, value_parser)]
53+
#[clap(long, value_parser)]
5454
driver_version: Option<String>,
5555

5656
/// Major browser version (e.g., 105, 106, etc. Also: beta, dev, canary -or nightly- is accepted)
57-
#[clap(short = 'B', long, value_parser)]
57+
#[clap(long, value_parser)]
5858
browser_version: Option<String>,
5959

6060
/// Browser path (absolute) for browser version detection (e.g., /usr/bin/google-chrome,
6161
/// "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome",
6262
/// "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe")
63-
#[clap(short = 'P', long, value_parser)]
63+
#[clap(long, value_parser)]
6464
browser_path: Option<String>,
6565

6666
/// Output type: LOGGER (using INFO, WARN, etc.), JSON (custom JSON notation), or SHELL (Unix-like)
67-
#[clap(short = 'O', long, value_parser, default_value = "LOGGER")]
67+
#[clap(long, value_parser, default_value = "LOGGER")]
6868
output: String,
6969

7070
/// HTTP proxy for network connection (e.g., https://myproxy.net:8080)
71-
#[clap(short = 'p', long, value_parser)]
71+
#[clap(long, value_parser)]
7272
proxy: Option<String>,
7373

7474
/// Timeout for network requests (in seconds)
75-
#[clap(short = 't', long, value_parser, default_value_t = REQUEST_TIMEOUT_SEC)]
75+
#[clap(long, value_parser, default_value_t = REQUEST_TIMEOUT_SEC)]
7676
timeout: u64,
7777

78-
/// Display DEBUG messages
79-
#[clap(short = 'D', long)]
80-
debug: bool,
81-
82-
/// Display TRACE messages
83-
#[clap(short = 'T', long)]
84-
trace: bool,
85-
86-
/// Clear driver cache
87-
#[clap(short, long)]
88-
clear_cache: bool,
89-
90-
/// Set default driver ttl
78+
/// Driver TTL (time-to-live)
9179
#[clap(long, value_parser, default_value_t = TTL_DRIVERS_SEC)]
9280
driver_ttl: u64,
9381

94-
/// Set default browser ttl
82+
/// Browser TTL (time-to-live)
9583
#[clap(long, value_parser, default_value_t = TTL_BROWSERS_SEC)]
9684
browser_ttl: u64,
9785

98-
/// Clear metadata file
86+
/// Clear cache folder (~/.cache/selenium)
87+
#[clap(long)]
88+
clear_cache: bool,
89+
90+
/// Clear metadata file (~/.cache/selenium/selenium-manager.json)
9991
#[clap(long)]
10092
clear_metadata: bool,
93+
94+
/// Display DEBUG messages
95+
#[clap(long)]
96+
debug: bool,
97+
98+
/// Display TRACE messages
99+
#[clap(long)]
100+
trace: bool,
101101
}
102102

103103
fn main() {

0 commit comments

Comments
 (0)