From: Francis Deslauriers Date: Mon, 4 Nov 2019 20:28:38 +0000 (-0500) Subject: cli: set `bt_config::command_name` field for all commands X-Git-Tag: v2.0.0-rc3~50 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=ea106f93ba6581a8e199a43b0d7bf54da8a014bd cli: set `bt_config::command_name` field for all commands This field is used in babeltrace2.c to print the pretty print the command name in different logging messages. Signed-off-by: Francis Deslauriers Change-Id: I953ea162a33212157236be5295183e39fb866ff4 Reviewed-on: https://review.lttng.org/c/babeltrace/+/2331 Reviewed-by: Simon Marchi Tested-by: jenkins --- diff --git a/src/cli/babeltrace2-cfg-cli-args.c b/src/cli/babeltrace2-cfg-cli-args.c index 57ccabf3..f0c64a3f 100644 --- a/src/cli/babeltrace2-cfg-cli-args.c +++ b/src/cli/babeltrace2-cfg-cli-args.c @@ -4613,14 +4613,19 @@ struct bt_config *bt_config_cli_args_create(int argc, const char *argv[], if (strcmp(item_non_opt->arg, "convert") == 0) { command_type = COMMAND_TYPE_CONVERT; + command_name = "convert"; } else if (strcmp(item_non_opt->arg, "list-plugins") == 0) { command_type = COMMAND_TYPE_LIST_PLUGINS; + command_name = "list-plugins"; } else if (strcmp(item_non_opt->arg, "help") == 0) { command_type = COMMAND_TYPE_HELP; + command_name = "help"; } else if (strcmp(item_non_opt->arg, "query") == 0) { command_type = COMMAND_TYPE_QUERY; + command_name = "query"; } else if (strcmp(item_non_opt->arg, "run") == 0) { command_type = COMMAND_TYPE_RUN; + command_name = "run"; } else { /* * Non-option argument, but not a known