X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcli%2Fbabeltrace2-cfg-cli-args.c;h=e7ee709a91f2b1504f7e0133870aff6905843121;hb=5f2a1585bf407f3f3aa7e63d9041b75390cf8563;hp=1246fe8889457ff1727627084e9c7d9e0860f977;hpb=c57d9a632f05cfbac2b160a6127cace399bbaf5e;p=babeltrace.git diff --git a/src/cli/babeltrace2-cfg-cli-args.c b/src/cli/babeltrace2-cfg-cli-args.c index 1246fe88..e7ee709a 100644 --- a/src/cli/babeltrace2-cfg-cli-args.c +++ b/src/cli/babeltrace2-cfg-cli-args.c @@ -1724,7 +1724,7 @@ void print_run_usage(FILE *fp) fprintf(fp, " -x, --connect=CONNECTION Connect two created components (see the\n"); fprintf(fp, " expected format of CONNECTION below)\n"); fprintf(fp, " -l, --log-level=LVL Set the log level of the current component to LVL\n"); - fprintf(fp, " (`N`, `V`, `D`, `I`, `W`, `E`, or `F`)\n"); + fprintf(fp, " (`N`, `T`, `D`, `I`, `W`, `E`, or `F`)\n"); fprintf(fp, " -p, --params=PARAMS Add initialization parameters PARAMS to the\n"); fprintf(fp, " current component (see the expected format\n"); fprintf(fp, " of PARAMS below)\n"); @@ -2128,7 +2128,7 @@ void print_convert_usage(FILE *fp) fprintf(fp, " conversion graph, and optionally name it\n"); fprintf(fp, " NAME\n"); fprintf(fp, " -l, --log-level=LVL Set the log level of the current component to LVL\n"); - fprintf(fp, " (`N`, `V`, `D`, `I`, `W`, `E`, or `F`)\n"); + fprintf(fp, " (`N`, `T`, `D`, `I`, `W`, `E`, or `F`)\n"); fprintf(fp, " -p, --params=PARAMS Add initialization parameters PARAMS to the\n"); fprintf(fp, " current component (see the expected format\n"); fprintf(fp, " of PARAMS below)\n"); @@ -3136,7 +3136,7 @@ enum convert_current_item_type { static struct bt_config *bt_config_convert_from_args(int argc, const char *argv[], int *retcode, const bt_value *plugin_paths, - int *default_log_level) + int *default_log_level, const bt_interrupter *interrupter) { enum convert_current_item_type current_item_type = CONVERT_CURRENT_ITEM_TYPE_NONE; @@ -3442,10 +3442,16 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[], * it in `non_opt_params`. */ bt_value *array; + bt_value_array_append_element_status append_element_status; uint64_t idx = bt_value_array_get_length(non_opt_params) - 1; array = bt_value_array_borrow_element_by_index(non_opt_params, idx); - bt_value_array_append_string_element(array, arg); + + append_element_status = bt_value_array_append_string_element(array, arg); + if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) { + BT_CLI_LOGE_APPEND_CAUSE_OOM(); + goto error; + } } else { BT_CLI_LOGE_APPEND_CAUSE( "No current component (--component option) or non-option argument of which to set parameters:\n %s", @@ -3843,7 +3849,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[], case OPT_STREAM_INTERSECTION: /* * Applies to all traces implementing the - * babeltrace.trace-info query. + * babeltrace.trace-infos query. */ stream_intersection_mode = true; break; @@ -4047,9 +4053,13 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[], status = auto_discover_source_components(non_opts, plugins, plugin_count, auto_source_discovery_restrict_component_class_name, - *default_log_level, &auto_disc); + *default_log_level, &auto_disc, interrupter); if (status != 0) { + if (status == AUTO_SOURCE_DISCOVERY_STATUS_INTERRUPTED) { + BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN( + "Babeltrace CLI", "Automatic source discovery interrupted by the user"); + } goto error; } @@ -4396,9 +4406,9 @@ void print_gen_usage(FILE *fp) fprintf(fp, "\n"); fprintf(fp, "General options:\n"); fprintf(fp, "\n"); - fprintf(fp, " -d, --debug Enable debug mode (same as --log-level=V)\n"); + fprintf(fp, " -d, --debug Enable debug mode (same as --log-level=T)\n"); fprintf(fp, " -h, --help Show this help and quit\n"); - fprintf(fp, " -l, --log-level=LVL Set the default log level to LVL (`N`, `V`, `D`,\n"); + fprintf(fp, " -l, --log-level=LVL Set the default log level to LVL (`N`, `T`, `D`,\n"); fprintf(fp, " `I`, `W` (default), `E`, or `F`)\n"); fprintf(fp, " --omit-home-plugin-path Omit home plugins from plugin search path\n"); fprintf(fp, " (~/.local/lib/babeltrace2/plugins)\n"); @@ -4422,7 +4432,8 @@ void print_gen_usage(FILE *fp) struct bt_config *bt_config_cli_args_create(int argc, const char *argv[], int *retcode, bool omit_system_plugin_path, bool omit_home_plugin_path, - const bt_value *initial_plugin_paths) + const bt_value *initial_plugin_paths, + const bt_interrupter *interrupter) { struct bt_config *config = NULL; int i; @@ -4652,7 +4663,7 @@ struct bt_config *bt_config_cli_args_create(int argc, const char *argv[], break; case COMMAND_TYPE_CONVERT: config = bt_config_convert_from_args(command_argc, command_argv, - retcode, plugin_paths, &default_log_level); + retcode, plugin_paths, &default_log_level, interrupter); break; case COMMAND_TYPE_LIST_PLUGINS: config = bt_config_list_plugins_from_args(command_argc,