Rename "ignore-absolute" parameter to "assume-absolute-clock-classes"
[babeltrace.git] / cli / babeltrace-cfg-cli-args.c
index ae43510a6045829d1072464fa47cf5c6109ade48..a1eb78b5f00de03d5b0dd474e082ca97217418d5 100644 (file)
@@ -40,6 +40,9 @@
 #include "babeltrace-cfg-cli-args.h"
 #include "babeltrace-cfg-cli-args-connect.h"
 
+#define BT_LOG_TAG "CLI-CFG-ARGS"
+#include "logging.h"
+
 /*
  * Error printf() macro which prepends "Error: " the first time it's
  * called. This gives a nicer feel than having a bunch of error prefixes
@@ -402,7 +405,7 @@ int ini_handle_state(struct ini_parsing_state *state)
                state->expecting = INI_EXPECT_MAP_KEY;
                goto success;
        default:
-               assert(false);
+               abort();
        }
 
 error:
@@ -886,7 +889,7 @@ void bt_config_destroy(struct bt_object *obj)
                }
                break;
        default:
-               assert(false);
+               abort();
        }
 
        g_free(cfg);
@@ -1306,6 +1309,7 @@ enum {
 };
 
 enum bt_config_component_dest {
+       BT_CONFIG_COMPONENT_DEST_UNKNOWN = -1,
        BT_CONFIG_COMPONENT_DEST_SOURCE,
        BT_CONFIG_COMPONENT_DEST_FILTER,
        BT_CONFIG_COMPONENT_DEST_SINK,
@@ -1333,7 +1337,7 @@ void add_run_cfg_comp(struct bt_config *cfg,
                g_ptr_array_add(cfg->cmd_data.run.sinks, cfg_comp);
                break;
        default:
-               assert(false);
+               abort();
        }
 }
 
@@ -1852,7 +1856,7 @@ struct bt_config *bt_config_help_from_args(int argc, const char *argv[],
                                        BT_COMPONENT_CLASS_TYPE_SINK;
                                break;
                        default:
-                               assert(false);
+                               abort();
                        }
                        plug_comp_cls_names = strdup(arg);
                        if (!plug_comp_cls_names) {
@@ -2065,7 +2069,7 @@ struct bt_config *bt_config_query_from_args(int argc, const char *argv[],
                                type = BT_COMPONENT_CLASS_TYPE_SINK;
                                break;
                        default:
-                               assert(false);
+                               abort();
                        }
 
                        cfg->cmd_data.query.cfg_component =
@@ -2410,7 +2414,8 @@ struct bt_config *bt_config_run_from_args(int argc, const char *argv[],
        poptContext pc = NULL;
        char *arg = NULL;
        struct bt_config_component *cur_cfg_comp = NULL;
-       enum bt_config_component_dest cur_cfg_comp_dest;
+       enum bt_config_component_dest cur_cfg_comp_dest =
+                       BT_CONFIG_COMPONENT_DEST_UNKNOWN;
        struct bt_value *cur_base_params = NULL;
        int opt, ret = 0;
        struct bt_config *cfg = NULL;
@@ -2533,7 +2538,7 @@ struct bt_config *bt_config_run_from_args(int argc, const char *argv[],
                                opt_name = "--sink";
                                break;
                        default:
-                               assert(false);
+                               abort();
                        }
 
                        if (cur_cfg_comp) {
@@ -3082,7 +3087,7 @@ int append_run_args_for_implicit_component(
                }
                break;
        default:
-               assert(false);
+               abort();
        }
 
        if (bt_value_array_append_string(run_args,
@@ -3319,7 +3324,7 @@ int convert_append_name_param(enum bt_config_component_dest dest,
                        *sink_names = g_list_append(*sink_names, name);
                        break;
                default:
-                       assert(false);
+                       abort();
                }
 
                g_string_assign(cur_name_prefix, "");
@@ -3564,7 +3569,8 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
 {
        poptContext pc = NULL;
        char *arg = NULL;
-       enum bt_config_component_dest cur_comp_dest;
+       enum bt_config_component_dest cur_comp_dest =
+                       BT_CONFIG_COMPONENT_DEST_UNKNOWN;
        int opt, ret = 0;
        struct bt_config *cfg = NULL;
        bool got_verbose_opt = false;
@@ -3751,7 +3757,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                }
                                break;
                        default:
-                               assert(false);
+                               abort();
                        }
 
                        if (bt_value_array_append_string(run_args, arg)) {
@@ -4060,7 +4066,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                        break;
                case OPT_CLOCK_FORCE_CORRELATE:
                        append_implicit_component_param(
-                               &implicit_muxer_args, "force-correlate", "yes");
+                               &implicit_muxer_args, "assume-absolute-clock-classes", "yes");
                        break;
                case OPT_CLOCK_GMT:
                        append_implicit_component_param(
@@ -4302,7 +4308,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                if (implicit_lttng_live_args.exists) {
                        lttng_live_url_parts =
                                bt_common_parse_lttng_live_url(leftover,
-                                       error_buf, 256);
+                                       error_buf, sizeof(error_buf));
                        if (!lttng_live_url_parts.proto) {
                                printf_err("Invalid LTTng live URL format: %s\n",
                                        error_buf);
@@ -4756,7 +4762,7 @@ struct bt_config *bt_config_cli_args_create(int argc, const char *argv[],
                        force_omit_home_plugin_path, initial_plugin_paths);
                break;
        default:
-               assert(false);
+               abort();
        }
 
        if (config) {
This page took 0.025768 seconds and 4 git commands to generate.