Skip to content

Commit

Permalink
Fix more clap deprecation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Jan 4, 2025
1 parent d5e5878 commit c286656
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,10 @@ pub(crate) fn parse_args() -> Mode {
_ => unreachable!("clap has already validated the values"),
};

let syntax_highlight = matches.value_of("syntax-highlight") == Some("on");
let syntax_highlight = matches
.get_one::<String>("syntax-highlight")
.map(|s| s.as_str())
== Some("on");

let sort_paths = matches.get_flag("sort-paths");

Expand Down Expand Up @@ -772,7 +775,7 @@ pub(crate) fn parse_args() -> Mode {

let set_exit_code = matches.get_flag("exit-code");

let strip_cr = matches.value_of("strip-cr") == Some("on");
let strip_cr = matches.get_one::<String>("strip-cr").map(|s| s.as_str()) == Some("on");

let check_only = matches.get_flag("check-only");

Expand Down

0 comments on commit c286656

Please sign in to comment.