buildertool: Make render an alias for screenshot
authorMatthias Clasen <mclasen@redhat.com>
Mon, 26 Jun 2023 14:57:11 +0000 (10:57 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 26 Jun 2023 14:58:35 +0000 (10:58 -0400)
Its a more neutral name and will align better with
other tools.

docs/reference/gtk/gtk4-builder-tool.rst
tools/gtk-builder-tool-screenshot.c
tools/gtk-builder-tool.c

index ad38532949c47ce4e9aac67636eacdb352f91209..2eb44c30e9296b48f89d0eea64f517f6cd30335a 100644 (file)
@@ -16,6 +16,7 @@ SYNOPSIS
 |   **gtk4-builder-tool** enumerate [OPTIONS...] <FILE>
 |   **gtk4-builder-tool** simplify [OPTIONS...] <FILE>
 |   **gtk4-builder-tool** preview [OPTIONS...] <FILE>
+|   **gtk4-builder-tool** render [OPTIONS...] <FILE>
 |   **gtk4-builder-tool** screenshot [OPTIONS...] <FILE>
 
 DESCRIPTION
@@ -69,12 +70,11 @@ file to use.
 
   Load style information from the given CSS file.
 
-Screenshot
-^^^^^^^^^^
+Render
+^^^^^^
 
-The ``screenshot`` command saves a rendering of the UI definition file
-as a png image or node file. The name of the file to write can be specified as
-a second FILE argument.
+The ``render`` command saves a rendering of the UI definition file as a png image
+or node file. The name of the file to write can be specified as a second FILE argument.
 
 This command accepts options to specify the ID of the toplevel object and a CSS
 file to use.
@@ -96,6 +96,11 @@ file to use.
 
   Overwrite an existing file.
 
+Screenshot
+^^^^^^^^^^
+
+The ``screenshot`` command is an alias for ``render``.
+
 Simplification
 ^^^^^^^^^^^^^^
 
index bf4847c9e542949a748bcc2a80b22827e7bcee37..d6f33a39c2fbff0f621bd00987347a1481b43405 100644 (file)
@@ -371,11 +371,11 @@ do_screenshot (int          *argc,
       exit (1);
     }
 
-  g_set_prgname ("gtk4-builder-tool screenshot");
+  g_set_prgname ("gtk4-builder-tool render");
   context = g_option_context_new (NULL);
   g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
   g_option_context_add_main_entries (context, entries, NULL);
-  g_option_context_set_summary (context, _("Take a screenshot of the file."));
+  g_option_context_set_summary (context, _("Render a .ui file to an image."));
 
   if (!g_option_context_parse (context, argc, (char ***)argv, &error))
     {
@@ -394,7 +394,7 @@ do_screenshot (int          *argc,
 
   if (g_strv_length (filenames) > 2)
     {
-      g_printerr (_("Can only screenshot a single .ui file and a single output file\n"));
+      g_printerr (_("Can only render a single .ui file to a single output file\n"));
       exit (1);
     }
 
index 347c96211b8d9c34bda2dcca015a2326ee0aef22..5ac829b519c824f29316432864bad3db78303ef5 100644 (file)
@@ -43,6 +43,7 @@ usage (void)
              "  simplify     Simplify the file\n"
              "  enumerate    List all named objects\n"
              "  preview      Preview the file\n"
+             "  render       Take a screenshot of the file\n"
              "  screenshot   Take a screenshot of the file\n"
              "\n"));
   exit (1);
@@ -134,7 +135,8 @@ main (int argc, const char *argv[])
     do_enumerate (&argc, &argv);
   else if (strcmp (argv[0], "preview") == 0)
     do_preview (&argc, &argv);
-  else if (strcmp (argv[0], "screenshot") == 0)
+  else if (strcmp (argv[0], "render") == 0 ||
+           strcmp (argv[0], "screenshot") == 0)
     do_screenshot (&argc, &argv);
   else
     usage ();