Commit 78a5a246 78a5a2460f380a4856fb8116153c8747b40dbcb6 by Sam Roberts

Added -d flags.

1 parent a37b1105
......@@ -30,6 +30,8 @@ UserAgent (header_t hdr)
&& sz != 0)
return agent;
/* Some MUAs, like Pine, put their name in the Message-Id, so print it as
a last ditch attempt at getting an idea who produced the date. */
if (header_get_value (hdr, "Message-Id", agent, sizeof (agent), &sz) == 0
&& sz != 0)
return agent;
......@@ -45,6 +47,19 @@ main (int argc, char **argv)
size_t count = 0;
char *mboxname = argv[1];
int status;
int debug = 0;
if (strcmp ("-d", mboxname) == 0)
{
mboxname = argv[2];
debug = 1;
}
if (mboxname == NULL)
{
printf ("Usage: mbox-dates [-d] <mbox>\n");
exit (1);
}
/* Register desired mailbox formats. */
{
......@@ -62,11 +77,12 @@ main (int argc, char **argv)
exit (1);
}
{
mu_debug_t debug;
mailbox_get_debug (mbox, &debug);
// mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
}
if (debug)
{
mu_debug_t debug;
mailbox_get_debug (mbox, &debug);
mu_debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT);
}
if ((status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
{
......
......@@ -23,7 +23,15 @@ main (int argc, char **argv)
char *mbox_name = 0;
char *dir_name = 0;
int status;
int debug = 0;
if (strcmp("-d", argv[1]) == 0 && argc == 4)
{
debug = 1;
argc--;
argv[1] = argv[2];
argv[2] = argv[3];
}
if (argc != 3)
{
printf ("usage: mbox-explode <mbox> <directory>\n");
......@@ -46,6 +54,7 @@ main (int argc, char **argv)
mbox_name, strerror (status));
exit (1);
}
if(debug)
{
mu_debug_t debug;
mailbox_get_debug (mbox, &debug);
......@@ -119,3 +128,4 @@ main (int argc, char **argv)
return status;
}
......