+ case OPT_BEGIN:
+ if (!cur_cfg_comp) {
+ printf_err("Can not apply parameter to unavailable default source component \"%s\".\n",
+ DEFAULT_SOURCE_COMPONENT_NAME);
+ goto error;
+ }
+ if (cur_cfg_comp_dest != BT_CONFIG_COMPONENT_DEST_SOURCE) {
+ printf_err("--begin option must follow a --source option\n");
+ goto error;
+ }
+ if (bt_value_map_insert_string(cur_cfg_comp->params,
+ "begin", arg)) {
+ print_err_oom();
+ goto error;
+ }
+ break;
+ case OPT_END:
+ if (!cur_cfg_comp) {
+ printf_err("Can not apply parameter to unavailable default source component \"%s\".\n",
+ DEFAULT_SOURCE_COMPONENT_NAME);
+ goto error;
+ }
+ if (cur_cfg_comp_dest != BT_CONFIG_COMPONENT_DEST_SOURCE) {
+ printf_err("--end option must follow a --source option\n");
+ goto error;
+ }
+ if (bt_value_map_insert_string(cur_cfg_comp->params,
+ "end", arg)) {
+ print_err_oom();
+ goto error;
+ }
+ break;
+ case OPT_TIMERANGE:
+ {
+ const char *begin, *end;
+
+ if (!cur_cfg_comp) {
+ printf_err("Can not apply parameter to unavailable default source component \"%s\".\n",
+ DEFAULT_SOURCE_COMPONENT_NAME);
+ goto error;
+ }
+ if (cur_cfg_comp_dest != BT_CONFIG_COMPONENT_DEST_SOURCE) {
+ printf_err("--timerange option must follow a --source option\n");
+ goto error;
+ }
+ if (split_timerange(arg, &begin, &end)) {
+ printf_err("Invalid --timerange format, expecting: begin,end or [begin,end] (where [] are actual brackets)\n");
+ goto error;
+ }
+ if (bt_value_map_insert_string(cur_cfg_comp->params,
+ "begin", begin)) {
+ print_err_oom();
+ goto error;
+ }
+ if (bt_value_map_insert_string(cur_cfg_comp->params,
+ "end", end)) {
+ print_err_oom();
+ goto error;
+ }
+ break;
+ }