common: support custom, extra information for build's version
[babeltrace.git] / src / cli / babeltrace2-cfg-cli-args.c
index 381fc484e48c1696b5e613778c317ed0920acc52..73d67d7785d50f42ff89788d28dd4a10a5a07dd5 100644 (file)
@@ -197,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);
        }
 }
 
@@ -3440,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);
@@ -3448,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;
                                        }
@@ -4010,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.024589 seconds and 4 git commands to generate.