summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-03-25 00:44:09 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-03-25 00:44:09 +0100
commit31e8c83a5748a385f3db4561605da54b52ac2dc9 (patch)
treef2e5f055420c75569620d36bad485f10c8e776a6 /src
parent46f706319695dc77d66ab5f7cbc5cbdcad707366 (diff)
downloadabrt-31e8c83a5748a385f3db4561605da54b52ac2dc9.tar.gz
abrt-31e8c83a5748a385f3db4561605da54b52ac2dc9.tar.xz
abrt-31e8c83a5748a385f3db4561605da54b52ac2dc9.zip
add option -p to abrt-gui and wizard too
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui-gtk/main.c14
-rw-r--r--src/gui-wizard-gtk/main.c14
2 files changed, 22 insertions, 6 deletions
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index 652d1882..4602012c 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -25,7 +25,7 @@
# include <locale.h>
#endif
-#define PROGNAME "abrt-gtk"
+#define PROGNAME "abrt-gui"
static int inotify_fd = -1;
static GIOChannel *channel_inotify;
@@ -155,21 +155,29 @@ int main(int argc, char **argv)
/* Can't keep these strings/structs static: _() doesn't support that */
const char *program_usage_string = _(
- PROGNAME" [-v] [DIR]...\n\n"
+ PROGNAME" [-vp] [DIR]...\n"
+ "\n"
"Shows list of ABRT dump directories in specified DIR(s)\n"
"(default DIRs: "DEBUG_DUMPS_DIR" $HOME/.abrt/spool)"
);
enum {
OPT_v = 1 << 0,
+ OPT_p = 1 << 1,
};
/* Keep enum above and order of options below in sync! */
struct options program_options[] = {
OPT__VERBOSE(&g_verbose),
+ OPT_BOOL( 'p', NULL, NULL , _("Add program names to log")),
OPT_END()
};
- /*unsigned opts =*/ parse_opts(argc, argv, program_options, program_usage_string);
+ unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose));
+ if (opts & OPT_p)
+ {
+ msg_prefix = PROGNAME;
+ putenv((char*)"ABRT_PROG_PREFIX=1");
+ }
GtkWidget *main_window = create_main_window();
diff --git a/src/gui-wizard-gtk/main.c b/src/gui-wizard-gtk/main.c
index 3dc0b824..1cb9e261 100644
--- a/src/gui-wizard-gtk/main.c
+++ b/src/gui-wizard-gtk/main.c
@@ -77,23 +77,31 @@ int main(int argc, char **argv)
/* Can't keep these strings/structs static: _() doesn't support that */
const char *program_usage_string = _(
- PROGNAME" [-v] [-g GUI_FILE] DIR\n\n"
- "GUI tool to analyze and report ABRT crash in specified DIR"
+ PROGNAME" [-vp] [-g GUI_FILE] DIR\n"
+ "\n"
+ "GUI tool to analyze and report problem saved in specified DIR"
);
enum {
OPT_v = 1 << 0,
OPT_g = 1 << 1,
+ OPT_p = 1 << 2,
};
/* Keep enum above and order of options below in sync! */
struct options program_options[] = {
OPT__VERBOSE(&g_verbose),
OPT_STRING('g', NULL, &g_glade_file, "FILE" , _("Alternate GUI file")),
+ OPT_BOOL( 'p', NULL, NULL , _("Add program names to log")),
OPT_END()
};
- /*unsigned opts =*/ parse_opts(argc, argv, program_options, program_usage_string);
+ unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose));
+ if (opts & OPT_p)
+ {
+ msg_prefix = PROGNAME;
+ putenv((char*)"ABRT_PROG_PREFIX=1");
+ }
argv += optind;
if (!argv[0] || argv[1]) /* zero or >1 arguments */