mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
glib-compile-schemas: Add a --version option
https://bugzilla.gnome.org/show_bug.cgi?id=772269
This commit is contained in:
parent
bce8b6db8d
commit
6338cde7ca
@ -74,6 +74,13 @@ Print help and exit
|
|||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--version</option></term>
|
||||||
|
<listitem><para>
|
||||||
|
Print program version and exit
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>--targetdir=<replaceable>TARGET</replaceable></option></term>
|
<term><option>--targetdir=<replaceable>TARGET</replaceable></option></term>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
|
@ -2025,6 +2025,7 @@ main (int argc, char **argv)
|
|||||||
GDir *dir;
|
GDir *dir;
|
||||||
const gchar *file;
|
const gchar *file;
|
||||||
gchar *srcdir;
|
gchar *srcdir;
|
||||||
|
gboolean show_version_and_exit = FALSE;
|
||||||
gchar *targetdir = NULL;
|
gchar *targetdir = NULL;
|
||||||
gchar *target;
|
gchar *target;
|
||||||
gboolean dry_run = FALSE;
|
gboolean dry_run = FALSE;
|
||||||
@ -2033,6 +2034,7 @@ main (int argc, char **argv)
|
|||||||
gchar **override_files = NULL;
|
gchar **override_files = NULL;
|
||||||
GOptionContext *context;
|
GOptionContext *context;
|
||||||
GOptionEntry entries[] = {
|
GOptionEntry entries[] = {
|
||||||
|
{ "version", 0, 0, G_OPTION_ARG_NONE, &show_version_and_exit, N_("Show program version and exit"), NULL },
|
||||||
{ "targetdir", 0, 0, G_OPTION_ARG_FILENAME, &targetdir, N_("where to store the gschemas.compiled file"), N_("DIRECTORY") },
|
{ "targetdir", 0, 0, G_OPTION_ARG_FILENAME, &targetdir, N_("where to store the gschemas.compiled file"), N_("DIRECTORY") },
|
||||||
{ "strict", 0, 0, G_OPTION_ARG_NONE, &strict, N_("Abort on any errors in schemas"), NULL },
|
{ "strict", 0, 0, G_OPTION_ARG_NONE, &strict, N_("Abort on any errors in schemas"), NULL },
|
||||||
{ "dry-run", 0, 0, G_OPTION_ARG_NONE, &dry_run, N_("Do not write the gschema.compiled file"), NULL },
|
{ "dry-run", 0, 0, G_OPTION_ARG_NONE, &dry_run, N_("Do not write the gschema.compiled file"), NULL },
|
||||||
@ -2079,6 +2081,12 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
g_option_context_free (context);
|
g_option_context_free (context);
|
||||||
|
|
||||||
|
if (show_version_and_exit)
|
||||||
|
{
|
||||||
|
g_print (PACKAGE_VERSION "\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!schema_files && argc != 2)
|
if (!schema_files && argc != 2)
|
||||||
{
|
{
|
||||||
fprintf (stderr, _("You should give exactly one directory name\n"));
|
fprintf (stderr, _("You should give exactly one directory name\n"));
|
||||||
|
Loading…
Reference in New Issue
Block a user