print-editor: Add --version support

Since it is easy now.
This commit is contained in:
Matthias Clasen 2024-12-10 21:18:44 -05:00
parent 761e92c664
commit cec8d46b6a

View File

@ -861,6 +861,7 @@ main (int argc, char **argv)
{
GtkApplication *app;
GError *error = NULL;
char version[80];
gtk_init ();
@ -881,6 +882,13 @@ main (int argc, char **argv)
app = gtk_application_new ("org.gtk.PrintEditor4", G_APPLICATION_HANDLES_OPEN);
g_snprintf (version, sizeof (version), "%s%s%s\n",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "");
g_application_set_version (G_APPLICATION (app), version);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);