summaryrefslogtreecommitdiffstats
path: root/src/cli/CLI.cpp
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-08-19 16:07:07 +0200
committerKarel Klic <kklic@redhat.com>2010-08-19 16:07:07 +0200
commitbd9e90bd8d6359a8cbb2799a50d805e768b20059 (patch)
tree15d458fc04f98452f126f6038bfb6a862a29f5c8 /src/cli/CLI.cpp
parentb29287e42aff6238bc8acd7c7843c93f6785232c (diff)
downloadabrt-bd9e90bd8d6359a8cbb2799a50d805e768b20059.tar.gz
abrt-bd9e90bd8d6359a8cbb2799a50d805e768b20059.tar.xz
abrt-bd9e90bd8d6359a8cbb2799a50d805e768b20059.zip
abrt-cli --info: Make coredump and rating fields optional
Diffstat (limited to 'src/cli/CLI.cpp')
-rw-r--r--src/cli/CLI.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/cli/CLI.cpp b/src/cli/CLI.cpp
index d1cc13d8..425ab2d5 100644
--- a/src/cli/CLI.cpp
+++ b/src/cli/CLI.cpp
@@ -102,8 +102,6 @@ static void print_crash_info(const map_crash_data_t& crash, bool show_backtrace)
"Command: %s\n"
"Executable: %s\n"
"System: %s, kernel %s\n"
- "Rating: %s\n"
- "Coredump file: %s\n"
"Reason: %s\n"),
get_crash_data_item_content(crash, CD_UID).c_str(),
get_crash_data_item_content(crash, CD_UUID).c_str(),
@@ -115,13 +113,22 @@ static void print_crash_info(const map_crash_data_t& crash, bool show_backtrace)
get_crash_data_item_content(crash, FILENAME_EXECUTABLE).c_str(),
get_crash_data_item_content(crash, FILENAME_RELEASE).c_str(),
get_crash_data_item_content(crash, FILENAME_KERNEL).c_str(),
- get_crash_data_item_content(crash, FILENAME_RATING).c_str(),
- get_crash_data_item_content(crash, FILENAME_COREDUMP).c_str(),
get_crash_data_item_content(crash, FILENAME_REASON).c_str());
free((void *)timeloc);
- /* print only if available */
+ /* Print optional fields only if they are available */
+
+ /* Coredump is not present in kerneloopses and Python exceptions. */
+ const char *coredump = get_crash_data_item_content_or_NULL(crash, FILENAME_COREDUMP);
+ if (coredump)
+ printf(_("Coredump file: %s\n"), coredump);
+
+ const char *rating = get_crash_data_item_content_or_NULL(crash, FILENAME_RATING);
+ if (rating)
+ printf(_("Rating: %s\n"), rating);
+
+ /* Crash function is not present in kerneloopses, and before the full report is created.*/
const char *crash_function = get_crash_data_item_content_or_NULL(crash, FILENAME_CRASH_FUNCTION);
if (crash_function)
printf(_("Crash function: %s\n"), crash_function);