[librsvg/update-clap: 7/11] See if the keep_aspect option is present using the old method




commit 4db939cf06fcef04226083fd349499c2e42272cb
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Sep 20 11:19:17 2022 -0500

    See if the keep_aspect option is present using the old method
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/748>

 src/bin/rsvg-convert.rs | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index b40439364..26bde8a24 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -921,7 +921,6 @@ fn parse_args() -> Result<Converter, Error> {
             clap::Arg::with_name("keep_aspect")
                 .short('a')
                 .long("keep-aspect-ratio")
-                .default_value("false")
                 .help("Preserve the aspect ratio"),
         )
         .arg(
@@ -1063,10 +1062,6 @@ fn parse_args() -> Result<Converter, Error> {
         ));
     }
 
-    let keep_aspect_ratio = *matches
-        .get_one("keep_aspect")
-        .expect("already provided default_value");
-
     let export_id: Option<String> = matches.get_one::<String>("export_id").map(lookup_id);
 
     Ok(Converter {
@@ -1083,7 +1078,7 @@ fn parse_args() -> Result<Converter, Error> {
         page_size,
         format,
         export_id,
-        keep_aspect_ratio,
+        keep_aspect_ratio: matches.contains_id("keep_aspect"),
         background_color,
         stylesheet: matches.value_of_os("stylesheet").map(PathBuf::from),
         unlimited: matches.contains_id("unlimited"),


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