Move --print-variables handling after --exists for consistency

The --print-variables output is inconsistent with other printing options
when --exists is supplied or not. Move the handling after --exists like
--print-requires and others requiring a valid package list so that
--exists is given it takes priority and exits early.

Freedesktop #54384 (https://bugs.freedesktop.org/show_bug.cgi?id=54384)
This commit is contained in:
Dan Nicholson 2012-10-30 17:34:20 -07:00
parent 90e0ec0f6f
commit d6a14488db

31
main.c
View file

@ -572,6 +572,21 @@ main (int argc, char **argv)
if (failed) {
return 1;
}
}
g_string_free (str, TRUE);
packages = g_slist_reverse (packages);
if (packages == NULL)
{
fprintf (stderr, "Must specify package names on the command line\n");
exit (1);
}
if (want_exists)
return 0; /* if we got here, all the packages existed. */
if (want_variable_list)
{
@ -590,22 +605,6 @@ main (int argc, char **argv)
need_newline = FALSE;
}
}
g_string_free (str, TRUE);
packages = g_slist_reverse (packages);
if (packages == NULL)
{
fprintf (stderr, "Must specify package names on the command line\n");
exit (1);
}
if (want_exists)
return 0; /* if we got here, all the packages existed. */
if (want_uninstalled)
{
/* See if > 0 pkgs (including dependencies recursively) were uninstalled */