From 16f2b7bdb8ffdb84e7bd142bde91c7670c63a3e7 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 21 Dec 2011 13:05:25 +0100 Subject: cli: specify common options in a new group Actions on modems from specific interfaces, like 3GPP, will also need the modem to be specified. The new 'Common' option group will handle all options to specify objects. --- cli/mmcli-bearer.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'cli/mmcli-bearer.c') diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c index b3bb85e1..5fe50fab 100644 --- a/cli/mmcli-bearer.c +++ b/cli/mmcli-bearer.c @@ -43,17 +43,12 @@ typedef struct { static Context *ctx; /* Options */ -static gchar *bearer_str; static gboolean info_flag; /* set when no action found */ static gchar *connect_with_number_str; static gboolean connect_flag; static gboolean disconnect_flag; static GOptionEntry entries[] = { - { "bearer", 'b', 0, G_OPTION_ARG_STRING, &bearer_str, - "Specify bearer by path. Shows bearer information if no action specified.", - NULL - }, { "connect", 'c', 0, G_OPTION_ARG_NONE, &connect_flag, "Connect a given bearer using the default number, if any.", NULL @@ -94,7 +89,7 @@ mmcli_bearer_options_enabled (void) connect_flag + disconnect_flag); - if (n_actions == 0 && bearer_str) { + if (n_actions == 0 && mmcli_get_common_bearer_string ()) { /* default to info */ info_flag = TRUE; n_actions++; @@ -330,7 +325,7 @@ mmcli_bearer_run_asynchronous (GDBusConnection *connection, /* Get proper bearer */ mmcli_get_bearer (connection, - bearer_str, + mmcli_get_common_bearer_string (), cancellable, (GAsyncReadyCallback)get_bearer_ready, NULL); @@ -344,7 +339,7 @@ mmcli_bearer_run_synchronous (GDBusConnection *connection) /* Initialize context */ ctx = g_new0 (Context, 1); ctx->bearer = mmcli_get_bearer_sync (connection, - bearer_str, + mmcli_get_common_bearer_string (), &ctx->manager, &ctx->object); -- cgit v1.2.3-70-g09d2