summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-12-03 18:56:33 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2010-12-03 18:56:33 +0100
commit3ea8cd037dcd5a8439baceadc8df70664eff701c (patch)
tree666eeca05e2b1c77bd5d0a117e2003f206b19183
parent3433c06718591fe930b9ae99501d0aa0f52b3f9c (diff)
downloadabrt-3ea8cd037dcd5a8439baceadc8df70664eff701c.tar.gz
abrt-3ea8cd037dcd5a8439baceadc8df70664eff701c.tar.xz
abrt-3ea8cd037dcd5a8439baceadc8df70664eff701c.zip
preparatory patch: add -v to abrt-cli; remove unused func; make func static
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--src/cli/CLI.cpp6
-rw-r--r--src/cli/report.cpp19
-rw-r--r--src/daemon/MiddleWare.cpp12
-rw-r--r--src/daemon/MiddleWare.h14
-rw-r--r--src/lib/make_descr.cpp2
5 files changed, 16 insertions, 37 deletions
diff --git a/src/cli/CLI.cpp b/src/cli/CLI.cpp
index 44271329..64d629b8 100644
--- a/src/cli/CLI.cpp
+++ b/src/cli/CLI.cpp
@@ -210,6 +210,7 @@ static const struct option longopts[] =
{
/* name, has_arg, flag, val */
{ "help" , no_argument, NULL, '?' },
+ { "verbose" , no_argument, NULL, 'v' },
{ "version" , no_argument, NULL, 'V' },
{ "list" , no_argument, NULL, 'l' },
{ "full" , no_argument, NULL, 'f' },
@@ -243,6 +244,7 @@ static void usage(char *argv0)
printf(_("Usage: %s [OPTION]\n\n"
"Startup:\n"
" -V, --version display the version of %s and exit\n"
+ " -v, --verbose increase verbosity\n"
" -?, --help print this help\n\n"
"Actions:\n"
" -l, --list print a list of all crashes which are not yet reported\n"
@@ -278,8 +280,7 @@ int main(int argc, char** argv)
while (1)
{
/* Do not use colons, arguments are handled after parsing all options. */
- int c = getopt_long_only(argc, argv, "?Vrdlfyib",
- longopts, NULL);
+ int c = getopt_long(argc, argv, "?Vvrdlfyib", longopts, NULL);
#define SET_OP(newop) \
if (op != -1 && op != newop) \
@@ -298,6 +299,7 @@ int main(int argc, char** argv)
case 'f': full = true; break;
case 'y': always = true; break;
case 'b': backtrace = true; break;
+ case 'v': g_verbose++; break;
case -1: /* end of options */ break;
default: /* some error */
case '?':
diff --git a/src/cli/report.cpp b/src/cli/report.cpp
index 27e12ac8..88154d53 100644
--- a/src/cli/report.cpp
+++ b/src/cli/report.cpp
@@ -435,25 +435,6 @@ static void read_from_stdin(const char *question, char *result, int result_size)
strchrnul(result, '\n')[0] = '\0';
}
-/** Splits a string into substrings using chosen delimiters.
- * @param delim
- * Specifies a set of characters that delimit the
- * tokens in the parsed string
- */
-static GList *split(const char *s, const char delim)
-{
- GList *elems = NULL;
- while (1)
- {
- const char *end = strchrnul(s, delim);
- elems = g_list_append(elems, xstrndup(s, end - s));
- if (*end == '\0')
- break;
- s = end + 1;
- }
- return elems;
-}
-
/**
* Asks a [y/n] question on stdin/stdout.
* Returns true if the answer is yes, false otherwise.
diff --git a/src/daemon/MiddleWare.cpp b/src/daemon/MiddleWare.cpp
index 4e79a8bc..22e49620 100644
--- a/src/daemon/MiddleWare.cpp
+++ b/src/daemon/MiddleWare.cpp
@@ -100,12 +100,22 @@ static char *do_log_and_update_client(char *log_line, void *param)
return log_line;
}
+/**
+ * Takes care of getting all additional data needed
+ * for computing UUIDs and creating a report for particular analyzer
+ * plugin. This report could be send somewhere afterwards. If a creation
+ * is successful, then a crash report is filled.
+ * @param pAnalyzer A name of an analyzer plugin.
+ * @param pDebugDumpPath A debugdump dir containing all necessary data.
+ * @param pCrashData A filled crash report.
+ * @return It return results of operation. See mw_result_t.
+ */
/*
* Called in two cases:
* (1) by StartJob dbus call -> CreateReportThread(), in the thread
* (2) by CreateReport dbus call
*/
-mw_result_t CreateCrashReport(const char *dump_dir_name,
+static mw_result_t CreateCrashReport(const char *dump_dir_name,
long caller_uid,
int force,
map_crash_data_t& pCrashData)
diff --git a/src/daemon/MiddleWare.h b/src/daemon/MiddleWare.h
index 808d7be4..78c6a839 100644
--- a/src/daemon/MiddleWare.h
+++ b/src/daemon/MiddleWare.h
@@ -46,20 +46,6 @@ typedef enum {
/**
- * Takes care of getting all additional data needed
- * for computing UUIDs and creating a report for particular analyzer
- * plugin. This report could be send somewhere afterwards. If a creation
- * is successful, then a crash report is filled.
- * @param pAnalyzer A name of an analyzer plugin.
- * @param pDebugDumpPath A debugdump dir containing all necessary data.
- * @param pCrashData A filled crash report.
- * @return It return results of operation. See mw_result_t.
- */
-mw_result_t CreateCrashReport(const char *dump_dir_name,
- long caller_uid,
- int force,
- map_crash_data_t& pCrashData);
-/**
* Activates particular action plugin.
* @param pActionDir A directory, which is passed as working to a action plugin.
* @param pPluginName An action plugin name.
diff --git a/src/lib/make_descr.cpp b/src/lib/make_descr.cpp
index e11325c8..5502b581 100644
--- a/src/lib/make_descr.cpp
+++ b/src/lib/make_descr.cpp
@@ -223,7 +223,7 @@ char* make_description_logger(const map_crash_data_t& pCrashData)
if (was_multiline)
{
if (buf_long_dsc->len != 0)
- strbuf_append_char(buf_long_dsc,'\n');
+ strbuf_append_char(buf_long_dsc, '\n');
strbuf_append_str(buf_long_dsc, tmp);
}