info: Minor cleanup

This commit is contained in:
Alexander Larsson committed 2016-10-06 12:31:54 +02:00
1 parent 11bd2ff8e1
commit 90bcc44e10
1 file changed
+13 -12
+13 -12
View File
@@ -53,6 +53,16 @@ static GOptionEntry options[] = {
{ NULL }
};
/* Print space unless this is the first item */
static void
maybe_print_space (gboolean *first)
{
if (*first)
*first = FALSE;
else
g_print (" ");
}
gboolean
flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError **error)
{
@@ -141,30 +151,21 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError *
if (opt_show_ref)
{
if (first)
first = FALSE;
else
g_print (" ");
maybe_print_space (&first);
g_print ("%s", ref);
}
if (opt_show_origin)
{
if (first)
first = FALSE;
else
g_print (" ");
maybe_print_space (&first);
g_print ("%s", origin ? origin : "-");
}
if (opt_show_commit)
{
if (first)
first = FALSE;
else
g_print (" ");
maybe_print_space (&first);
g_print ("%s", commit);
}