[librsvg/update-clap] Make the 'output' option take a PathBuf value parser
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/update-clap] Make the 'output' option take a PathBuf value parser
- Date: Tue, 20 Sep 2022 16:53:10 +0000 (UTC)
commit 6a4f860895c5a2d93e4a4d5e90db913527a62709
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Sep 20 10:05:30 2022 -0500
Make the 'output' option take a PathBuf value parser
src/bin/rsvg-convert.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index 8f8efd6ed..da1f3bdb5 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -896,7 +896,7 @@ fn parse_args() -> Result<Converter, Error> {
clap::Arg::with_name("output")
.short('o')
.long("output")
- .empty_values(false)
+ .value_parser(clap::value_parser!(PathBuf))
.help("Output filename [defaults to stdout]"),
)
.arg(
@@ -1066,8 +1066,8 @@ fn parse_args() -> Result<Converter, Error> {
language,
input,
output: matches
- .value_of_os("output")
- .map(PathBuf::from)
+ .get_one::<PathBuf>("output")
+ .cloned()
.map(Output::Path)
.unwrap_or(Output::Stdout),
testing: matches.is_present("testing"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]