[librsvg/update-clap] Fix the stylesheet argument



commit 4fabac49373f3a4df5c704594b8c603a2638f786
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Sep 20 11:48:25 2022 -0500

    Fix the stylesheet argument

 src/bin/rsvg-convert.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index 7a37dbcfe..3b2ebbfe4 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -940,7 +940,8 @@ fn parse_args() -> Result<Converter, Error> {
             clap::Arg::with_name("stylesheet")
                 .short('s')
                 .long("stylesheet")
-                .empty_values(false)
+                .takes_value(true)
+                .value_parser(clap::value_parser!(PathBuf))
                 .value_name("filename.css")
                 .help("Filename of CSS stylesheet to apply"),
         )
@@ -1089,7 +1090,7 @@ fn parse_args() -> Result<Converter, Error> {
         export_id,
         keep_aspect_ratio: matches.contains_id("keep_aspect"),
         background_color,
-        stylesheet: matches.value_of_os("stylesheet").map(PathBuf::from),
+        stylesheet: matches.get_one("stylesheet").cloned(),
         unlimited: matches.contains_id("unlimited"),
         keep_image_data,
         language,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]