aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2011-10-27 17:12:20 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:25 +0100
commit9e241b7062883a67a31500a6f095c9839c8666c8 (patch)
treea4f21755a5e471e0547590126c036cb9742c6700 /cli/mmcli.c
parentc37949d7ba20e33633951e57d89c6cfe3e968790 (diff)
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.
Diffstat (limited to 'cli/mmcli.c')
-rw-r--r--cli/mmcli.c12
1 files changed, 7 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2011 Aleksander Morgado <aleksander@gnu.org>
+ * Copyright (C) 2011 Google, Inc.
*/
#include "config.h"
@@ -28,7 +29,7 @@
#include <glib.h>
#include <gio/gio.h>
-#include <libmm.h>
+#include <libmm-glib.h>
#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 */