summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-05-23 12:21:22 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-05-23 12:30:36 -0400
commit2f07e562fc1fe370d3c7d9ce70158480a33d3a0a (patch)
treee7be7629c0faac2aec2c1116724a25cf7a055323 /utils
parent65404213f278a2b80794e4d46458f786cd9b70b3 (diff)
downloadpango-2f07e562fc1fe370d3c7d9ce70158480a33d3a0a.tar.gz
pango-list: Add --version
Diffstat (limited to 'utils')
-rw-r--r--utils/pango-list.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/utils/pango-list.c b/utils/pango-list.c
index 6e81fd6e..82a5647c 100644
--- a/utils/pango-list.c
+++ b/utils/pango-list.c
@@ -46,10 +46,12 @@ main (int argc,
gboolean opt_verbose = FALSE;
gboolean opt_metrics = FALSE;
gboolean opt_variations = FALSE;
+ gboolean opt_version = FALSE;
GOptionEntry entries[] = {
- {"verbose", 0, 0, G_OPTION_ARG_NONE, &opt_verbose, "Print verbose information", NULL },
- {"metrics", 0, 0, G_OPTION_ARG_NONE, &opt_metrics, "Print font metrics", NULL },
- {"variations", 0, 0, G_OPTION_ARG_NONE, &opt_variations, "Print font variations", NULL },
+ { "verbose", 0, 0, G_OPTION_ARG_NONE, &opt_verbose, "Print verbose information", NULL },
+ { "metrics", 0, 0, G_OPTION_ARG_NONE, &opt_metrics, "Print font metrics", NULL },
+ { "variations", 0, 0, G_OPTION_ARG_NONE, &opt_variations, "Print font variations", NULL },
+ { "version", 0, 0, G_OPTION_ARG_NONE, &opt_version, "Show version" },
{ NULL, }
};
GOptionContext *context;
@@ -77,6 +79,12 @@ main (int argc,
g_option_context_free (context);
+ if (opt_version)
+ {
+ g_print ("%s (%s) %s\n", g_get_prgname (), PACKAGE_NAME, PACKAGE_VERSION);
+ exit (0);
+ }
+
/* Use PangoCairo to get default fontmap so it works on every platform. */
fontmap = pango_cairo_font_map_get_default ();
ctx = pango_font_map_create_context (fontmap);