aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-common.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-common.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-common.c')
-rw-r--r--cli/mmcli-common.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/cli/mmcli-common.c b/cli/mmcli-common.c
index 0bb80473..bf44a108 100644
--- a/cli/mmcli-common.c
+++ b/cli/mmcli-common.c
@@ -549,3 +549,47 @@ mmcli_get_lock_string (MMModemLock lock)
value = g_enum_get_value (enum_class, lock);
return value->value_nick;
}
+
+/* Common options */
+static gchar *modem_str;
+static gchar *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.",
+ "[PATH|INDEX]"
+ },
+ { "bearer", 'b', 0, G_OPTION_ARG_STRING, &bearer_str,
+ "Specify bearer by path. Shows bearer information if no action specified.",
+ "[PATH]"
+ },
+ { NULL }
+};
+
+GOptionGroup *
+mmcli_get_common_option_group (void)
+{
+ GOptionGroup *group;
+
+ /* Status options */
+ group = g_option_group_new ("common",
+ "Common options",
+ "Show common options",
+ NULL,
+ NULL);
+ g_option_group_add_entries (group, entries);
+
+ return group;
+}
+
+const gchar *
+mmcli_get_common_modem_string (void)
+{
+ return modem_str;
+}
+
+const gchar *
+mmcli_get_common_bearer_string (void)
+{
+ return bearer_str;
+}