tools: Cosmetics
authorMatthias Clasen <mclasen@redhat.com>
Mon, 15 May 2023 12:03:20 +0000 (08:03 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 15 May 2023 12:03:20 +0000 (08:03 -0400)
Make gtk-builder-tool screenshot be quiet unless
it had to make up a filename. And tweak --help
output a bit.

tools/gtk-builder-tool-screenshot.c

index cf20eaec8849c6294ffea9b585c533733f7e346a..bf4847c9e542949a748bcc2a80b22827e7bcee37 100644 (file)
@@ -328,7 +328,8 @@ screenshot_file (const char *filename,
                            g_bytes_get_size (bytes),
                            &error))
     {
-      g_print (_("Output written to %s.\n"), save_to);
+      if (save_file == NULL)
+        g_print (_("Output written to %s.\n"), save_to);
     }
   else
     {
@@ -359,7 +360,7 @@ do_screenshot (int          *argc,
     { "css", 0, 0, G_OPTION_ARG_FILENAME, &css, N_("Use style from CSS file"), N_("FILE") },
     { "node", 0, 0, G_OPTION_ARG_NONE, &as_node, N_("Save as node file instead of png"), NULL },
     { "force", 0, 0, G_OPTION_ARG_NONE, &force, N_("Overwrite existing file"), NULL },
-    { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL, N_("FILE") },
+    { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL, N_("FILE") },
     { NULL, }
   };
   GError *error = NULL;