[librsvg/update-clap: 10/11] Fix the stylesheet argument




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

    Fix the stylesheet argument
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/748>

 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]