[librsvg/update-clap: 3/11] Make the 'output' option take a PathBuf value parser



commit 8ac4a21af59ab1fe3a2a12e6a26fdf80f79a02c2
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
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/748>

 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]