*name = NULL;
g_string_free(gs_name, TRUE);
} else {
- *name = gs_name->str;
- g_string_free(gs_name, FALSE);
+ *name = g_string_free(gs_name, FALSE);
}
} else {
g_string_free(gs_name, TRUE);
}
- *plugin = gs_plugin->str;
- *comp_cls = gs_comp_cls->str;
- g_string_free(gs_plugin, FALSE);
- g_string_free(gs_comp_cls, FALSE);
+ *plugin = g_string_free(gs_plugin, FALSE);
+ *comp_cls = g_string_free(gs_comp_cls, FALSE);
gs_name = NULL;
gs_plugin = NULL;
gs_comp_cls = NULL;
bool has_extra = has_extra_name || has_extra_description ||
has_extra_patch_names;
- printf("Babeltrace " VERSION);
+ printf("%sBabeltrace %s%s",
+ bt_common_color_bold(),
+ VERSION,
+ bt_common_color_reset());
if (strlen(BT_VERSION_NAME) > 0) {
- printf(" \"%s\"", BT_VERSION_NAME);
+ printf(" \"%s%s%s%s\"",
+ bt_common_color_fg_bright_blue(),
+ bt_common_color_bold(),
+ BT_VERSION_NAME,
+ bt_common_color_reset());
}
if (strlen(BT_VERSION_GIT) > 0) {
- printf(" [%s]", BT_VERSION_GIT);
+ printf(" [%s%s%s]",
+ bt_common_color_fg_yellow(),
+ BT_VERSION_GIT,
+ bt_common_color_reset());
}
printf("\n");
printf("\n");
if (has_extra_name) {
- printf("Extra name: %s\n", BT_VERSION_EXTRA_NAME);
+ printf("%sExtra name%s: %s\n",
+ bt_common_color_fg_cyan(),
+ bt_common_color_reset(),
+ BT_VERSION_EXTRA_NAME);
}
if (has_extra_description) {
- printf("Extra description:\n ");
+ printf("%sExtra description%s:\n ",
+ bt_common_color_fg_cyan(),
+ bt_common_color_reset());
print_and_indent(BT_VERSION_EXTRA_DESCRIPTION);
}
if (has_extra_patch_names) {
- printf("Extra patch names:\n ");
+ printf("%sExtra patch names%s:\n ",
+ bt_common_color_fg_cyan(),
+ bt_common_color_reset());
print_and_indent(BT_VERSION_EXTRA_PATCHES);
}
}
BT_ASSERT(begin);
BT_ASSERT(end);
- *begin = g_begin->str;
- *end = g_end->str;
- g_string_free(g_begin, FALSE);
- g_string_free(g_end, FALSE);
+ *begin = g_string_free(g_begin, FALSE);
+ *end = g_string_free(g_end, FALSE);
g_begin = NULL;
g_end = NULL;
goto end;
switch (argpar_item_opt->descr->id) {
case OPT_BEGIN:
if (trimmer_has_begin) {
- printf("At --begin option: --begin or --timerange option already specified\n %s\n",
+ BT_CLI_LOGE_APPEND_CAUSE("At --begin option: --begin or --timerange option already specified\n %s\n",
arg);
goto error;
}
break;
case OPT_END:
if (trimmer_has_end) {
- printf("At --end option: --end or --timerange option already specified\n %s\n",
+ BT_CLI_LOGE_APPEND_CAUSE("At --end option: --end or --timerange option already specified\n %s\n",
arg);
goto error;
}
char *end;
if (trimmer_has_begin || trimmer_has_end) {
- printf("At --timerange option: --begin, --end, or --timerange option already specified\n %s\n",
+ BT_CLI_LOGE_APPEND_CAUSE("At --timerange option: --begin, --end, or --timerange option already specified\n %s\n",
arg);
goto error;
}