From 9e241b7062883a67a31500a6f095c9839c8666c8 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 27 Oct 2011 17:12:20 +0200 Subject: cli: port Manager actions to use the new libmm-glib The original command line interface was written based on a hand-made libmm. This commit ports the Manager interface handling to the new gdbus-codegen-based libmm-glib. --- cli/mmcli.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cli/mmcli.c') diff --git a/cli/mmcli.c b/cli/mmcli.c index ffbdca9b..85e4c4af 100644 --- a/cli/mmcli.c +++ b/cli/mmcli.c @@ -16,6 +16,7 @@ * along with this program. If not, see . * * Copyright (C) 2011 Aleksander Morgado + * Copyright (C) 2011 Google, Inc. */ #include "config.h" @@ -28,7 +29,7 @@ #include #include -#include +#include #include "mmcli.h" @@ -37,7 +38,6 @@ /* Globals */ static GMainLoop *loop; -static gboolean keep_loop; static GCancellable *cancellable; /* Context */ @@ -98,8 +98,7 @@ mmcli_async_operation_done (void) cancellable = NULL; } - if (!keep_loop) - g_main_loop_quit (loop); + g_main_loop_quit (loop); } gint @@ -147,9 +146,12 @@ main (gint argc, gchar **argv) /* Manager options? */ if (mmcli_manager_options_enabled ()) { if (async_flag) - keep_loop = mmcli_manager_run_asynchronous (connection, cancellable); + mmcli_manager_run_asynchronous (connection, cancellable); else mmcli_manager_run_synchronous (connection); + } else { + g_printerr ("error: no actions specified\n"); + exit (EXIT_FAILURE); } /* Run loop only in async operations */ -- cgit v1.2.3-70-g09d2