diff options
author | Karel Klic <kklic@redhat.com> | 2010-06-22 16:45:31 +0200 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2010-06-22 16:45:31 +0200 |
commit | e2c4e442285eafe1269825515c2c4a4ab1a1776a (patch) | |
tree | 6fafbd69cd924885c2487f7df115092afdbb7110 /src/CLI | |
parent | af82f994e39c60ee3c770ce8a724d5132161d24f (diff) | |
download | abrt-e2c4e442285eafe1269825515c2c4a4ab1a1776a.tar.gz abrt-e2c4e442285eafe1269825515c2c4a4ab1a1776a.tar.xz abrt-e2c4e442285eafe1269825515c2c4a4ab1a1776a.zip |
Show comment and how to reproduce fields when reporing crashes in abrt-cli
Diffstat (limited to 'src/CLI')
-rw-r--r-- | src/CLI/report.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp index e3ecb0e3..ebaeafa1 100644 --- a/src/CLI/report.cpp +++ b/src/CLI/report.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 RedHat inc. + Copyright (C) 2009, 2010 Red Hat, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -302,6 +302,19 @@ static int read_crash_report(map_crash_data_t &report, const char *text) } /** + * Ensures that the fields needed for editor are present in the crash data. + * Fields: comments, how to reproduce. + */ +static void create_fields_for_editor(map_crash_data_t &crash_data) +{ + if (crash_data.find(FILENAME_COMMENT) == crash_data.end()) + add_to_crash_data_ext(crash_data, FILENAME_COMMENT, CD_TXT, CD_ISEDITABLE, ""); + + if (crash_data.find(FILENAME_REPRODUCE) == crash_data.end()) + add_to_crash_data_ext(crash_data, FILENAME_REPRODUCE, CD_TXT, CD_ISEDITABLE, "1. \n2. \n3. \n"); +} + +/** * Runs external editor. * Returns: * 0 if the launch was successful @@ -663,6 +676,7 @@ int report(const char *crash_id, int flags) /* Open text editor and give a chance to review the backtrace etc. */ if (!(flags & CLI_REPORT_BATCH)) { + create_fields_for_editor(cr); int result = run_report_editor(cr); if (result != 0) return result; |