common: support custom, extra information for build's version
[babeltrace.git] / src / cli / babeltrace2-cfg-cli-args.c
index f80a38b5c92773f15c183f97160ef7a7a3231a78..73d67d7785d50f42ff89788d28dd4a10a5a07dd5 100644 (file)
 #include "autodisc/autodisc.h"
 #include "common/version.h"
 
-/* Offset option with "is set" boolean */
-struct offset_opt {
-       int64_t value;
-       bool is_set;
-};
-
-/* Legacy "ctf"/"lttng-live" format options */
-struct ctf_legacy_opts {
-       struct offset_opt offset_s;
-       struct offset_opt offset_ns;
-       bool stream_intersection;
-};
-
-/* Legacy "text" format options */
-struct text_legacy_opts {
-       /*
-        * output, dbg_info_dir, dbg_info_target_prefix, names,
-        * and fields are owned by this.
-        */
-       GString *output;
-       GString *dbg_info_dir;
-       GString *dbg_info_target_prefix;
-       const bt_value *names;
-       const bt_value *fields;
-
-       /* Flags */
-       bool no_delta;
-       bool clock_cycles;
-       bool clock_seconds;
-       bool clock_date;
-       bool clock_gmt;
-       bool dbg_info_full_path;
-       bool verbose;
-};
-
-/* Legacy input format format */
-enum legacy_input_format {
-       LEGACY_INPUT_FORMAT_NONE = 0,
-       LEGACY_INPUT_FORMAT_CTF,
-       LEGACY_INPUT_FORMAT_LTTNG_LIVE,
-};
-
-/* Legacy output format format */
-enum legacy_output_format {
-       LEGACY_OUTPUT_FORMAT_NONE = 0,
-       LEGACY_OUTPUT_FORMAT_TEXT,
-       LEGACY_OUTPUT_FORMAT_DUMMY,
-};
-
 #define BT_CLI_LOGE_APPEND_CAUSE_OOM() BT_CLI_LOGE_APPEND_CAUSE("Out of memory.")
 
 /*
@@ -246,10 +197,10 @@ end:
 static
 void print_version(void)
 {
-       if (GIT_VERSION[0] == '\0') {
+       if (BT_VERSION_GIT[0] == '\0') {
                puts("Babeltrace " VERSION);
        } else {
-               puts("Babeltrace " VERSION  " - " GIT_VERSION);
+               puts("Babeltrace " VERSION  " - " BT_VERSION_GIT);
        }
 }
 
@@ -3489,6 +3440,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                        }
                                } else if (current_item_type == CONVERT_CURRENT_ITEM_TYPE_NON_OPT) {
                                        uint64_t idx = bt_value_array_get_length(non_opt_loglevels) - 1;
+                                       enum bt_value_array_set_element_by_index_status set_element_status;
                                        bt_value *log_level_str_value;
 
                                        log_level_str_value = bt_value_string_create_init(arg);
@@ -3497,9 +3449,11 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                                goto error;
                                        }
 
-                                       if (bt_value_array_set_element_by_index(non_opt_loglevels, idx,
-                                                       log_level_str_value)) {
-                                               bt_value_put_ref(log_level_str_value);
+                                       set_element_status =
+                                               bt_value_array_set_element_by_index(non_opt_loglevels,
+                                                       idx, log_level_str_value);
+                                       bt_value_put_ref(log_level_str_value);
+                                       if (set_element_status != BT_VALUE_ARRAY_SET_ELEMENT_BY_INDEX_STATUS_OK) {
                                                BT_CLI_LOGE_APPEND_CAUSE_OOM();
                                                goto error;
                                        }
@@ -4059,7 +4013,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
 
                        if (auto_source_discovery_restrict_plugin_name) {
                                plugin_count = 1;
-                               plugin = find_loaded_plugin(auto_source_discovery_restrict_plugin_name);
+                               plugin = borrow_loaded_plugin_by_name(auto_source_discovery_restrict_plugin_name);
                                plugins = &plugin;
                        } else {
                                plugin_count = get_loaded_plugins_count();
This page took 0.025019 seconds and 4 git commands to generate.