mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
girepository: Combine input file validation code paths in utilities
The code and strings are the same, so let’s simplify things and reduce LoC for no functional change. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
08b3f14a32
commit
bd17a09862
@ -196,19 +196,13 @@ main (int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!input)
|
||||
if (!input || g_strv_length (input) != 1)
|
||||
{
|
||||
g_fprintf (stderr, "%s\n", _("Please specify exactly one input file"));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (g_strv_length (input) != 1)
|
||||
{
|
||||
g_printerr ("%s\n", _("Please specify exactly one input file"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
g_debug ("[parsing] start, %d includes",
|
||||
includedirs ? g_strv_length (includedirs) : 0);
|
||||
|
||||
|
@ -90,19 +90,13 @@ main (gint argc,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!namespaces)
|
||||
if (!namespaces || g_strv_length (namespaces) > 1)
|
||||
{
|
||||
status = EXIT_FAILURE;
|
||||
g_printerr ("%s\n", _("Please specify exactly one namespace"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (g_strv_length (namespaces) > 1)
|
||||
{
|
||||
status = EXIT_FAILURE;
|
||||
g_printerr ("%s\n", _("Please specify exactly one namespace"));
|
||||
goto out;
|
||||
}
|
||||
namespace = namespaces[0];
|
||||
|
||||
if (!opt_shlibs && !opt_typelibs)
|
||||
|
Loading…
Reference in New Issue
Block a user