summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2010-10-20 13:26:34 +0100
committerRichard Hughes <richard@hughsie.com>2010-10-20 13:26:34 +0100
commit694cb69c29c5b27a9de3726e3ba2329e6c663251 (patch)
tree385d6672b9952feb9d42b41d633cf7213fbf65bf /client
parent2c62053ed70de4383658409f13b5e720bd2ecd0c (diff)
trivial: ensure we use GOptionContext early in startup to avoid spilling debugging onto the console without --verbose
Diffstat (limited to 'client')
-rw-r--r--client/pk-console.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/client/pk-console.c b/client/pk-console.c
index 992658e5..5c976acb 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -1306,21 +1306,6 @@ main (int argc, char *argv[])
/* do stuff on ctrl-c */
signal (SIGINT, pk_console_sigint_cb);
- /* we need the roles early, as we only show the user only what they can do */
- control = pk_control_new ();
- ret = pk_control_get_properties (control, NULL, &error);
- if (!ret) {
- /* TRANSLATORS: we failed to contact the daemon */
- g_print ("%s: %s\n", _("Failed to contact PackageKit"), error->message);
- g_error_free (error);
- goto out_last;
- }
-
- /* get data */
- g_object_get (control,
- "roles", &roles,
- NULL);
-
summary = pk_console_get_summary ();
progressbar = pk_progress_bar_new ();
pk_progress_bar_set_size (progressbar, 25);
@@ -1336,6 +1321,21 @@ main (int argc, char *argv[])
options_help = g_option_context_get_help (context, TRUE, NULL);
g_option_context_free (context);
+ /* we need the roles early, as we only show the user only what they can do */
+ control = pk_control_new ();
+ ret = pk_control_get_properties (control, NULL, &error);
+ if (!ret) {
+ /* TRANSLATORS: we failed to contact the daemon */
+ g_print ("%s: %s\n", _("Failed to contact PackageKit"), error->message);
+ g_error_free (error);
+ goto out_last;
+ }
+
+ /* get data */
+ g_object_get (control,
+ "roles", &roles,
+ NULL);
+
/* check if we are on console */
if (!plain && isatty (fileno (stdout)) == 1)
is_console = TRUE;