X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fcli%2Fbabeltrace2.c;h=de0b6c2b7ef99c41e752fa4222c88c50bad00f83;hp=e32e1a0930f63160c3dbff47f2cea5305dd77dbc;hb=3dae1685cf1f1a368cd83928433eb778c8815dab;hpb=f0c01bee96c083f86cc98af9e3eb635629be128b diff --git a/src/cli/babeltrace2.c b/src/cli/babeltrace2.c index e32e1a09..de0b6c2b 100644 --- a/src/cli/babeltrace2.c +++ b/src/cli/babeltrace2.c @@ -2601,12 +2601,22 @@ int main(int argc, const char **argv) { int ret; int retcode; - struct bt_config *cfg; + struct bt_config *cfg = NULL; init_log_level(); set_signal_handler(); init_loaded_plugins(); - cfg = bt_config_cli_args_create_with_default(argc, argv, &retcode); + + BT_ASSERT(!the_interrupter); + the_interrupter = bt_interrupter_create(); + if (!the_interrupter) { + BT_CLI_LOGE_APPEND_CAUSE("Failed to create an interrupter object."); + retcode = 1; + goto end; + } + + cfg = bt_config_cli_args_create_with_default(argc, argv, &retcode, + the_interrupter); if (retcode < 0) { /* Quit without errors; typically usage/version */ @@ -2640,14 +2650,6 @@ int main(int argc, const char **argv) } } - BT_ASSERT(!the_interrupter); - the_interrupter = bt_interrupter_create(); - if (!the_interrupter) { - BT_CLI_LOGE_APPEND_CAUSE("Failed to create an interrupter object."); - retcode = 1; - goto end; - } - BT_LOGI("Executing command: cmd=%d, command-name=\"%s\"", cfg->command, cfg->command_name);