Skip to content

Adding more aliases for cli options. #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions src/bin/rnp/rnp_cli_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,22 @@ pub struct RnpCliOutputOptions {

#[structopt(
long = "log-csv",
alias = "oc",
parse(from_os_str),
help = "Log ping results a csv file."
help = "Log ping results a csv file. [alias: --oc]"
)]
pub csv_log_path: Option<PathBuf>,

#[structopt(
long = "log-json",
alias = "oj",
parse(from_os_str),
help = "Log ping results to a json file."
help = "Log ping results to a json file. [alias: --oj]"
)]
pub json_log_path: Option<PathBuf>,

#[structopt(
short = "o",
long = "log-text",
parse(from_os_str),
help = "Log ping results to a text file."
Expand Down Expand Up @@ -183,12 +186,12 @@ pub struct RnpCliOutputOptions {

#[derive(Debug, StructOpt, PartialEq)]
struct RnpCliQuicPingOptions {
#[structopt(long, help = "Specify the server name in the pings, such as QUIC.")]
#[structopt(long, help = "Specify the server name in the QUIC pings. Example: localhost.")]
pub server_name: Option<String>,

#[structopt(
long,
help = "Enable key logger in TLS for helping packet capture.\nPlease note that it might cause RTT to be larger than the real one, because logging key will also take time."
help = "Enable key logger in TLS for helping packet capture.\nPlease note that it might cause RTT to be slightly larger than the real one, because logging key will also take time."
)]
pub log_tls_key: bool,

Expand Down Expand Up @@ -424,9 +427,9 @@ mod tests {
},
output_options: RnpCliOutputOptions {
no_console_log: true,
csv_log_path: None,
json_log_path: None,
text_log_path: None,
csv_log_path: Some(PathBuf::from("log.csv")),
json_log_path: Some(PathBuf::from("log.json")),
text_log_path: Some(PathBuf::from("log.txt")),
show_result_scatter: true,
show_latency_scatter: true,
latency_buckets: Some(vec![0.1, 0.5, 1.0, 10.0]),
Expand Down Expand Up @@ -454,6 +457,12 @@ mod tests {
"-p",
"10",
"-q",
"--oc",
"log.csv",
"--oj",
"log.json",
"-o",
"log.txt",
"-r",
"-l",
"-b",
Expand Down