diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-03-09 14:00:25 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-03-09 14:00:25 +0100 |
commit | f4b0eaf367da6905b1f6f00304a866fb69a8b2d9 (patch) | |
tree | c075fac7f76b80f825beb7e7b75228e6152cd83e /src | |
parent | 04b894061f100b286a95e5a676f253101c9c87c1 (diff) | |
parent | b5b4d3ab76449493cfe3f58b7a7234de44f49e30 (diff) | |
download | abrt-f4b0eaf367da6905b1f6f00304a866fb69a8b2d9.tar.gz abrt-f4b0eaf367da6905b1f6f00304a866fb69a8b2d9.tar.xz abrt-f4b0eaf367da6905b1f6f00304a866fb69a8b2d9.zip |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src')
-rw-r--r-- | src/CLI/CLI.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index fcf1f0cd..c417619c 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -102,19 +102,24 @@ static char *guess_crash_id(const char *str) unsigned len = strlen(str); unsigned ii; + char *result = NULL; for (ii = 0; ii < num_crashinfos; ii++) { map_crash_data_t& info = ci[ii]; const char *this_uuid = get_crash_data_item_content(info, CD_UUID).c_str(); if (strncmp(str, this_uuid, len) == 0) { - return xasprintf("%s:%s", + if (result) + error_msg_and_die("Crash prefix '%s' is not unique", str); + result = xasprintf("%s:%s", get_crash_data_item_content(info, CD_UID).c_str(), this_uuid ); } } - error_msg_and_die("Crash '%s' not found", str); + if (!result) + error_msg_and_die("Crash '%s' not found", str); + return result; } static const struct option longopts[] = @@ -156,9 +161,9 @@ static void usage(char *argv0) " --report CRASH_ID create and send a report\n" " --report-always CRASH_ID create and send a report without asking\n" " --delete CRASH_ID remove crash\n" - "CRASH_ID may be:\n" - " an UID:UUID pair,\n" - " an UUID prefix - the first crash with matching UUID will be acted upon\n" + "CRASH_ID can be:\n" + " UID:UUID pair,\n" + " unique UUID prefix - the crash with matching UUID will be acted upon\n" " @N - N'th crash (as displayed by --get-list-full) will be acted upon\n" ), name, name); |