summaryrefslogtreecommitdiffstats
path: root/src/cli/cli.c
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2011-03-28 10:03:33 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2011-03-30 11:40:11 +0200
commit437fe4e8719276892f85d29d6e7f48caa1c021a9 (patch)
treeb9f178bbdd5756c622991156015f4619b04a1365 /src/cli/cli.c
parent76d34ec77e7f0aaeae645c06c61a6ad951f441a9 (diff)
downloadabrt-437fe4e8719276892f85d29d6e7f48caa1c021a9.zip
abrt-437fe4e8719276892f85d29d6e7f48caa1c021a9.tar.gz
abrt-437fe4e8719276892f85d29d6e7f48caa1c021a9.tar.xz
Ticket #178 abrt-cli should provide an option to select analyzer
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src/cli/cli.c')
-rw-r--r--src/cli/cli.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/cli/cli.c b/src/cli/cli.c
index 0af9ef2..8cace59 100644
--- a/src/cli/cli.c
+++ b/src/cli/cli.c
@@ -361,6 +361,9 @@ int main(int argc, char** argv)
print_usage_and_die(argv[0]);
}
+ /* Get settings */
+ load_event_config_data();
+
/* Do the selected operation. */
int exitcode = 0;
switch (op)
@@ -410,15 +413,37 @@ int main(int argc, char** argv)
}
case OPT_INFO:
{
- if (run_analyze_event(dump_dir_name) != 0)
- return 1;
-
/* Load crash_data from (possibly updated by analyze) dump dir */
struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
if (!dd)
return -1;
+
+ char *analyze_events_as_lines = list_possible_events(dd, NULL, "analyze");
+ dd_close(dd);
+
+ if (analyze_events_as_lines && *analyze_events_as_lines)
+ {
+ GList *list_analyze_events = str_to_glist(analyze_events_as_lines, '\n');
+ free(analyze_events_as_lines);
+
+ char *event = select_event_option(list_analyze_events);
+ list_free_with_free(list_analyze_events);
+
+ int analyzer_result = run_analyze_event(dump_dir_name, event);
+ free(event);
+
+ if (analyzer_result != 0)
+ return 1;
+ }
+
+ /* Load crash_data from (possibly updated by analyze) dump dir */
+ dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
+ if (!dd)
+ return -1;
+
crash_data_t *crash_data = create_crash_data_from_dump_dir(dd);
dd_close(dd);
+
add_to_crash_data_ext(crash_data, CD_DUMPDIR, dump_dir_name,
CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE);