Skip to content

Commit

Permalink
Fixed issue with parsing the throttle parameter. (#82)
Browse files Browse the repository at this point in the history
* Fixed issue with parsing the throttle parameter.

* Addressed changes and advanced the minor version number.
  • Loading branch information
paulhazen authored Nov 19, 2023
1 parent 377d20f commit 6995f0a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Types for Changes:

## [Unreleased] - ReleaseDate

## [0.16.3] - 2023-11-07

* Fixes issue with throttle parameter

## [0.16.2] - 2023-06-15

## [0.16.1] - 2022-12-19
Expand Down
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.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mlc"
version = "0.16.2"
version = "0.16.3"
authors = ["Armin Becher <[email protected]>"]
edition = "2018"
description = "The markup link checker (mlc) checks for broken links in markup files."
Expand Down
12 changes: 9 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ pub fn parse_args() -> Config {
.action(ArgAction::Append)
.value_delimiter(',')
.required(false))
.arg(arg!(-T --throttle <DELAY_MS> "Wait time in milliseconds between http request to the same host")
.arg(Arg::new("throttle")
.long("throttle")
.short('T')
.value_name("DELAY-MS")
.help("Wait time in milliseconds between http request to the same host")
.action(ArgAction::Append)
.required(false))
.arg(Arg::new("root-dir")
.long("root-dir")
Expand All @@ -83,8 +88,9 @@ pub fn parse_args() -> Config {
opt.debug = Some(true);
}

if let Some(throttle) = matches.get_one::<u32>("throttle") {
opt.throttle = Some(*throttle);
if let Some(throttle_str) = matches.get_one::<String>("throttle") {
let throttle = throttle_str.parse::<u32>().unwrap();
opt.throttle = Some(throttle);
}

if let Some(markup_types) = matches.get_many::<String>("markup-types") {
Expand Down

0 comments on commit 6995f0a

Please sign in to comment.