+}
+
+static void get_options(void)
+{
+ GSList *devices;
+ struct sr_dev_inst *sdi;
+ size_t get_idx;
+ char *get_text, *cg_name;
+ GHashTable *args;
+ GHashTableIter iter;
+ gpointer key, value;
+ struct sr_channel_group *cg;
+
+ /* Lookup and open the device. */
+ devices = device_scan();
+ if (!devices) {
+ g_critical("No devices found.");
+ return;
+ }
+ sdi = devices->data;
+ g_slist_free(devices);
+
+ if (sr_dev_open(sdi) != SR_OK) {
+ g_critical("Failed to open device.");
+ return;
+ }
+
+ /* Set configuration values when -c was specified. */
+ set_dev_options_array(sdi, opt_configs);
+
+ /* Get configuration values which were specified by --get. */
+ for (get_idx = 0; (get_text = opt_gets[get_idx]); get_idx++) {
+ args = parse_generic_arg(get_text, FALSE, "channel_group");
+ if (!args)
+ continue;
+ cg_name = g_hash_table_lookup(args, "sigrok_key");
+ cg = lookup_channel_group(sdi, cg_name);
+ g_hash_table_iter_init(&iter, args);
+ while (g_hash_table_iter_next(&iter, &key, &value)) {
+ if (g_ascii_strcasecmp(key, "sigrok_key") == 0)
+ continue;
+ get_option(sdi, cg, key);
+ }
+ }
+
+ /* Close the device. */