mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 12:25:48 +01:00
Add a --version option to g-ir-compiler and g-ir-generate. Fixes #55
This commit is contained in:
parent
496669495c
commit
98daf20188
@ -45,6 +45,7 @@ gchar **shlibs = NULL;
|
|||||||
gboolean include_cwd = FALSE;
|
gboolean include_cwd = FALSE;
|
||||||
gboolean debug = FALSE;
|
gboolean debug = FALSE;
|
||||||
gboolean verbose = FALSE;
|
gboolean verbose = FALSE;
|
||||||
|
gboolean show_version = FALSE;
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
write_out_typelib (gchar *prefix,
|
write_out_typelib (gchar *prefix,
|
||||||
@ -135,6 +136,7 @@ static GOptionEntry options[] =
|
|||||||
{ "shared-library", 'l', 0, G_OPTION_ARG_FILENAME_ARRAY, &shlibs, "shared library", "FILE" },
|
{ "shared-library", 'l', 0, G_OPTION_ARG_FILENAME_ARRAY, &shlibs, "shared library", "FILE" },
|
||||||
{ "debug", 0, 0, G_OPTION_ARG_NONE, &debug, "show debug messages", NULL },
|
{ "debug", 0, 0, G_OPTION_ARG_NONE, &debug, "show debug messages", NULL },
|
||||||
{ "verbose", 0, 0, G_OPTION_ARG_NONE, &verbose, "show verbose messages", NULL },
|
{ "verbose", 0, 0, G_OPTION_ARG_NONE, &verbose, "show verbose messages", NULL },
|
||||||
|
{ "version", 0, 0, G_OPTION_ARG_NONE, &show_version, "show program's version number and exit", NULL },
|
||||||
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &input, NULL, NULL },
|
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &input, NULL, NULL },
|
||||||
{ NULL, }
|
{ NULL, }
|
||||||
};
|
};
|
||||||
@ -174,6 +176,13 @@ main (int argc, char ** argv)
|
|||||||
|
|
||||||
g_log_set_default_handler (log_handler, NULL);
|
g_log_set_default_handler (log_handler, NULL);
|
||||||
|
|
||||||
|
if (show_version)
|
||||||
|
{
|
||||||
|
g_printf ("g-ir-compiler %u.%u.%u\n",
|
||||||
|
GI_MAJOR_VERSION, GI_MINOR_VERSION, GI_MICRO_VERSION);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!input)
|
if (!input)
|
||||||
{
|
{
|
||||||
g_fprintf (stderr, "no input files\n");
|
g_fprintf (stderr, "no input files\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user