Skip to content

Commit

Permalink
Improved arg parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
margual56 committed Oct 30, 2023
1 parent b59659b commit f3b6075
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "tcpreno"
authors = ["margual56@gmail.com"]
version = "1.0.1"
version = "1.0.2"
license = "GPL-2.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.0.29", features = ["derive"] }
clap = { version = "^4", features = ["derive"] }
plotly = "^0.8"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Options:
packets are lost in the cycles 10, 14 and 20

```bash
tcpreno --cycles 25 --threshold 8 -l 10 -l 14 -l 20 --algorithm "Reno"
tcpreno --cycles 25 --threshold 8 -l 10,14,20 --algorithm "Reno"
```

# Warning
Expand Down
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ struct Cli {
#[clap(long, short, help = "The initial threshold")]
threshold: u16,

#[clap(long, short, help = "An array of the cycles on which a loss occurs")]
#[clap(
long,
short,
value_parser,
value_delimiter = ',',
help = "An array of the cycles on which a loss occurs"
)]
losses: Vec<usize>,

#[clap(
Expand Down

0 comments on commit f3b6075

Please sign in to comment.