aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2011-12-21 13:05:25 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:36 +0100
commit16f2b7bdb8ffdb84e7bd142bde91c7670c63a3e7 (patch)
tree4b550a6713e540db2baa01b5f3e67a70a7c1a994 /cli/mmcli-modem.c
parent265a516f42a0ff8d2b421aa199e54d779f0c153f (diff)
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.
Diffstat (limited to 'cli/mmcli-modem.c')
-rw-r--r--cli/mmcli-modem.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c
index 2e5c74de..8974f10f 100644
--- a/cli/mmcli-modem.c
+++ b/cli/mmcli-modem.c
@@ -43,7 +43,6 @@ typedef struct {
static Context *ctx;
/* Options */
-static gchar *modem_str;
static gboolean info_flag; /* set when no action found */
static gboolean monitor_state_flag;
static gboolean enable_flag;
@@ -55,10 +54,6 @@ static gchar *create_bearer_str;
static gchar *delete_bearer_str;
static GOptionEntry entries[] = {
- { "modem", 'm', 0, G_OPTION_ARG_STRING, &modem_str,
- "Specify modem by path or index. Shows modem information if no action specified.",
- NULL
- },
{ "monitor-state", 'w', 0, G_OPTION_ARG_NONE, &monitor_state_flag,
"Monitor state of a given modem",
NULL
@@ -124,7 +119,7 @@ mmcli_modem_options_enabled (void)
!!delete_bearer_str +
!!factory_reset_str);
- if (n_actions == 0 && modem_str) {
+ if (n_actions == 0 && mmcli_get_common_modem_string ()) {
/* default to info */
info_flag = TRUE;
n_actions++;
@@ -759,7 +754,7 @@ mmcli_modem_run_asynchronous (GDBusConnection *connection,
/* Get proper modem */
mmcli_get_modem (connection,
- modem_str,
+ mmcli_get_common_modem_string (),
cancellable,
(GAsyncReadyCallback)get_modem_ready,
NULL);
@@ -775,7 +770,9 @@ mmcli_modem_run_synchronous (GDBusConnection *connection)
/* Initialize context */
ctx = g_new0 (Context, 1);
- ctx->object = mmcli_get_modem_sync (connection, modem_str, &ctx->manager);
+ ctx->object = mmcli_get_modem_sync (connection,
+ mmcli_get_common_modem_string (),
+ &ctx->manager);
ctx->modem = mm_object_get_modem (ctx->object);
/* Request to get info from modem? */