commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-192-gc2a9427


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-192-gc2a9427
Date: Mon, 15 Nov 2010 15:15:25 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=c2a942772fc73a7b6f48766982f12fbc3dee4f71

The branch, master has been updated
       via  c2a942772fc73a7b6f48766982f12fbc3dee4f71 (commit)
       via  7a9a5c138a9d226632a4b8c2fa16e4ba22c42697 (commit)
       via  7717d6fab8dd9168864990714574a82aa85f7229 (commit)
      from  d4582ca1b9a2d117f6f8db8fc5963c27f8c1fad4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c2a942772fc73a7b6f48766982f12fbc3dee4f71
Author: Sergey Poznyakoff <address@hidden>
Date:   Mon Nov 15 16:28:26 2010 +0200

    mh: Add new tests.
    
    * mh/mh_init.c (mh_install): Exit with code 1 on errors.
    * mh/tests/install-mh.at: New file.
    * mh/tests/pick.at: New file.
    * mh/tests/Makefile.am (TESTSUITE_AT): Add install-mh.at, pick.at.
    * mh/tests/testsuite.at: Include install-mh.at and pick.at.

commit 7a9a5c138a9d226632a4b8c2fa16e4ba22c42697
Author: Sergey Poznyakoff <address@hidden>
Date:   Mon Nov 15 13:19:09 2010 +0200

    mh: improve GNU option parser and help output.
    
    * mh/mh_argp.c (mh_argp_children): Set group number -2, to place
    help output between the application help and informational options.
    * mh/mhn.c (options): Regroup options,
    * mh/pick.c: Likewise.
    
    * mh/ali.c: Reword arg docs.
    * mh/anno.c: Likewise.
    * mh/burst.c: Likewise.
    * mh/comp.c: Likewise.
    * mh/fmtcheck.c: Likewise.
    * mh/folder.c: Likewise.
    * mh/forw.c: Likewise.
    * mh/inc.c: Likewise.
    * mh/install-mh.c: Likewise.
    * mh/mark.c: Likewise.
    * mh/mh_argp.c: Likewise.
    * mh/mhl.c: Likewise.
    * mh/mhn.c: Likewise.
    * mh/mhparam.c: Likewise.
    * mh/mhpath.c: Likewise.
    * mh/pick.c: Likewise.
    * mh/refile.c: Likewise.
    * mh/repl.c: Likewise.
    * mh/rmf.c: Likewise.
    * mh/rmm.c: Likewise.
    * mh/scan.c: Likewise.
    * mh/send.c: Likewise.
    * mh/sortm.c: Likewise.
    * mh/whom.c: Likewise.

commit 7717d6fab8dd9168864990714574a82aa85f7229
Author: Sergey Poznyakoff <address@hidden>
Date:   Mon Nov 15 12:37:11 2010 +0200

    mh: improve traditional option parser and help output.
    
    * mh/mh_getopt.h (mh_option): Move match_len to the end of the
    structure.  It should not be initialized.
    (mh_option_init): New prototype.
    
    * mh/mh_getopt.c (mh_option_init): New function.
    * mh/mh_argp.c (mh_argp_parse): Call mh_option_init.
    
    * mh/ali.c: Update mh_option declaration.
    * mh/anno.c: Likewise.
    * mh/burst.c: Likewise.
    * mh/comp.c: Likewise.
    * mh/fmtcheck.c: Likewise.
    * mh/folder.c: Likewise.
    * mh/forw.c: Likewise.
    * mh/inc.c: Likewise.
    * mh/install-mh.c: Likewise.
    * mh/mark.c: Likewise.
    * mh/mhl.c: Likewise.
    * mh/mhn.c: Likewise.
    * mh/mhparam.c: Likewise.
    * mh/mhpath.c: Likewise.
    * mh/pick.c: Likewise.
    * mh/refile.c: Likewise.
    * mh/repl.c: Likewise.
    * mh/rmf.c: Likewise.
    * mh/rmm.c: Likewise.
    * mh/scan.c: Likewise.
    * mh/send.c: Likewise.
    * mh/sortm.c: Likewise.
    * mh/whatnow.c: Likewise.
    * mh/whom.c: Likewise.

-----------------------------------------------------------------------

Summary of changes:
 mh/ali.c               |   14 +-
 mh/anno.c              |   10 +-
 mh/burst.c             |   10 +-
 mh/comp.c              |   24 ++--
 mh/fmtcheck.c          |   11 +-
 mh/folder.c            |   26 ++--
 mh/forw.c              |   32 +++---
 mh/inc.c               |   22 ++--
 mh/install-mh.c        |    7 +-
 mh/mark.c              |   14 +-
 mh/mh_argp.c           |    5 +-
 mh/mh_getopt.c         |   46 +++++++
 mh/mh_getopt.h         |    4 +-
 mh/mh_init.c           |    7 +-
 mh/mhl.c               |   16 ++--
 mh/mhn.c               |  106 +++++++++--------
 mh/mhparam.c           |    8 +-
 mh/mhpath.c            |    4 +-
 mh/pick.c              |  163 ++++++++++++++------------
 mh/refile.c            |   14 +-
 mh/repl.c              |   42 ++++----
 mh/rmf.c               |    4 +-
 mh/rmm.c               |    4 +-
 mh/scan.c              |   18 ++--
 mh/send.c              |   40 +++---
 mh/sortm.c             |   16 ++--
 mh/tests/Makefile.am   |    2 +
 mh/tests/install-mh.at |   63 ++++++++++
 mh/tests/pick.at       |  313 ++++++++++++++++++++++++++++++++++++++++++++++++
 mh/tests/testsuite.at  |    2 +
 mh/whatnow.c           |   14 +-
 mh/whom.c              |   14 +-
 32 files changed, 760 insertions(+), 315 deletions(-)
 create mode 100644 mh/tests/install-mh.at
 create mode 100644 mh/tests/pick.at

diff --git a/mh/ali.c b/mh/ali.c
index fa11429..9785574 100644
--- a/mh/ali.c
+++ b/mh/ali.c
@@ -26,7 +26,7 @@
 
 static char doc[] = N_("GNU MH ali")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("aliases ...");
+static char args_doc[] = N_("ALIAS [ALIAS...]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -45,12 +45,12 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  { "alias", 1, MH_OPT_ARG, "aliasfile" },
-  { "noalias", 3, },
-  { "list", 1, MH_OPT_BOOL },
-  { "normalize", 3, MH_OPT_BOOL },
-  { "user", 1, MH_OPT_BOOL },
-  { 0 }
+  { "alias", MH_OPT_ARG, "aliasfile" },
+  { "noalias", },
+  { "list", MH_OPT_BOOL },
+  { "normalize", MH_OPT_BOOL },
+  { "user", MH_OPT_BOOL },
+  { NULL }
 };
 
 static int list_mode;
diff --git a/mh/anno.c b/mh/anno.c
index 972268c..2e17f7e 100644
--- a/mh/anno.c
+++ b/mh/anno.c
@@ -22,7 +22,7 @@
 static char doc[] = N_("GNU MH anno")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[msg [msg...]]");
+static char args_doc[] = N_("[MSGLIST]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -42,10 +42,10 @@ static struct argp_option options[] = {
 };
 
 struct mh_option mh_option[] = {
-  {"inplace",   1, MH_OPT_BOOL },
-  {"date",      1, MH_OPT_BOOL },
-  {"component", 1, MH_OPT_ARG, "field"},
-  {"text",      1, MH_OPT_ARG, "body"},
+  { "inplace",   MH_OPT_BOOL },
+  { "date",      MH_OPT_BOOL },
+  { "component", MH_OPT_ARG, "field" },
+  { "text",      MH_OPT_ARG, "body" },
   { NULL }
 };
 
diff --git a/mh/burst.c b/mh/burst.c
index 8dc9163..5751513 100644
--- a/mh/burst.c
+++ b/mh/burst.c
@@ -25,7 +25,7 @@
 static char doc[] = N_("GNU MH burst")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = "[msgs]";
+static char args_doc[] = N_("[MSGLIST]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -50,10 +50,10 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"inplace",    1, MH_OPT_BOOL },
-  {"quiet",      1, MH_OPT_BOOL },
-  {"verbose",    1, MH_OPT_BOOL },
-  {NULL}
+  { "inplace",    MH_OPT_BOOL },
+  { "quiet",      MH_OPT_BOOL },
+  { "verbose",    MH_OPT_BOOL },
+  { NULL }
 };
 
 /* Command line switches */
diff --git a/mh/comp.c b/mh/comp.c
index 0f8830d..4def4f8 100644
--- a/mh/comp.c
+++ b/mh/comp.c
@@ -24,7 +24,7 @@
 static char doc[] = N_("GNU MH comp")"\v"
 N_("Options marked with `*' are not yet implemented.\n"
 "Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = "[msg]";
+static char args_doc[] = N_("[MSG]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -58,17 +58,17 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"build",         1, },
-  {"file",          2, MH_OPT_ARG, "draftfile"},
-  {"form",          2, MH_OPT_ARG, "formatfile"},
-  {"draftfolder",   6, MH_OPT_ARG, "folder"},
-  {"nodraftfolder", 3, },
-  {"draftmessage",  6, },
-  {"editor",        1, MH_OPT_ARG, "program"},
-  {"noedit",        3, },
-  {"whatnowproc",   2, MH_OPT_ARG, "program"},
-  {"nowhatnowproc", 3, },
-  { 0 }
+  { "build" },
+  { "file",          MH_OPT_ARG, "draftfile" },
+  { "form",          MH_OPT_ARG, "formatfile" },
+  { "draftfolder",   MH_OPT_ARG, "folder" },
+  { "nodraftfolder" },
+  { "draftmessage" },
+  { "editor",        MH_OPT_ARG, "program" },
+  { "noedit" },
+  { "whatnowproc",   MH_OPT_ARG, "program" },
+  { "nowhatnowproc" },
+  { NULL }
 };
 
 struct mh_whatnow_env wh_env = { 0 };
diff --git a/mh/fmtcheck.c b/mh/fmtcheck.c
index 216544d..10c0d65 100644
--- a/mh/fmtcheck.c
+++ b/mh/fmtcheck.c
@@ -21,7 +21,6 @@
 
 static char doc[] = N_("GNU MH fmtcheck")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = "";
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -34,14 +33,14 @@ static struct argp_option options[] = {
   { "debug",  ARG_DEBUG, NULL,     0,
     N_("enable parser debugging output"),},
 
-  { 0 }
+  { NULL }
 };
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"form",    4,  MH_OPT_ARG, "formatfile"},
-  {"format",  5,  MH_OPT_ARG, "string"},
-  { 0 }
+  { "form",    MH_OPT_ARG, "formatfile" },
+  { "format",  MH_OPT_ARG, "string" },
+  { NULL }
 };
 
 char *format_str;
@@ -97,7 +96,7 @@ main (int argc, char **argv)
   MU_APP_INIT_NLS ();
 
   mh_argp_init ();
-  mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
+  mh_argp_parse (&argc, &argv, 0, options, mh_option, NULL, doc,
                 opt_handler, NULL, NULL);
 
   if (format_str && mh_format_parse (format_str, &format))
diff --git a/mh/folder.c b/mh/folder.c
index 2b8f04e..57a9179 100644
--- a/mh/folder.c
+++ b/mh/folder.c
@@ -34,7 +34,7 @@
 
 static char doc[] = N_("GNU MH folder")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[action] [msg]");
+static char args_doc[] = N_("[ACTION] [MSG]");
 
 static struct argp_option options[] = {
   {N_("Actions are:"), 0, 0, OPTION_DOC, NULL, 0 },
@@ -83,18 +83,18 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"print",   2, 0, NULL },
-  {"list",    1, 0, NULL },
-  {"push",    2, 0, NULL },
-  {"pop",     2, 0, NULL },
-  {"all",     1, 0, NULL },
-  {"pack",    2, 0, NULL },
-  {"create",  1, MH_OPT_BOOL, NULL},
-  {"fast",    1, MH_OPT_BOOL, NULL},
-  {"header",  1, MH_OPT_BOOL, NULL},
-  {"recurse", 1, MH_OPT_BOOL, NULL},
-  {"total",   1, MH_OPT_BOOL, NULL},
-  {NULL},
+  { "print" },
+  { "list" },
+  { "push" },
+  { "pop" },
+  { "all" },
+  { "pack" },
+  { "create",  MH_OPT_BOOL },
+  { "fast",    MH_OPT_BOOL },
+  { "header",  MH_OPT_BOOL },
+  { "recurse", MH_OPT_BOOL },
+  { "total",   MH_OPT_BOOL },
+  { NULL }
 };
 
 typedef int (*folder_action) ();
diff --git a/mh/forw.c b/mh/forw.c
index 06a9de5..639706b 100644
--- a/mh/forw.c
+++ b/mh/forw.c
@@ -22,7 +22,7 @@
 static char doc[] = N_("GNU MH forw")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = "[msgs]";
+static char args_doc[] = N_("[MSGLIST]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -72,21 +72,21 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"annotate",      1, MH_OPT_BOOL },
-  {"build",         1, },
-  {"form",          4, MH_OPT_ARG, "formatfile"},
-  {"format",        5,  MH_OPT_ARG, "string"},
-  {"draftfolder",   6, MH_OPT_ARG, "folder"},
-  {"nodraftfolder", 3 },
-  {"draftmessage",  6, },
-  {"editor",        1, MH_OPT_ARG, "program"},
-  {"noedit",        3, },
-  {"filter",        2, MH_OPT_ARG, "program"},
-  {"inplace",       1, MH_OPT_BOOL },
-  {"whatnowproc",   2, MH_OPT_ARG, "program"},
-  {"nowhatnowproc", 3 },
-  {"mime",          2, MH_OPT_BOOL, NULL},
-  {NULL}
+  { "annotate",      MH_OPT_BOOL },
+  { "build" },
+  { "form",          MH_OPT_ARG, "formatfile"},
+  { "format",        MH_OPT_ARG, "string"},
+  { "draftfolder",   MH_OPT_ARG, "folder"},
+  { "nodraftfolder" },
+  { "draftmessage" },
+  { "editor",        MH_OPT_ARG, "program"},
+  { "noedit" },
+  { "filter",        MH_OPT_ARG, "program"},
+  { "inplace",       MH_OPT_BOOL },
+  { "whatnowproc",   MH_OPT_ARG, "program"},
+  { "nowhatnowproc" },
+  { "mime",          MH_OPT_BOOL },
+  { NULL }
 };
 
 enum encap_type {
diff --git a/mh/inc.c b/mh/inc.c
index d2fb0a3..dde43fe 100644
--- a/mh/inc.c
+++ b/mh/inc.c
@@ -21,7 +21,7 @@
 
 static char doc[] = N_("GNU MH inc")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[+folder]");
+static char args_doc[] = N_("[+FOLDER]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -52,16 +52,16 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"audit",     5, MH_OPT_ARG, "audit-file" },
-  {"noaudit",   3, 0, },
-  {"changecur", 1, MH_OPT_BOOL},
-  {"file",      2, MH_OPT_ARG, "input-file"},
-  {"form",      4, MH_OPT_ARG, "format-file"},
-  {"format",    5, MH_OPT_ARG, "string"},
-  {"truncate",  2, MH_OPT_BOOL, },
-  {"width",     1, MH_OPT_ARG, "number"},
-  {"quiet",     1, 0, },
-  { 0 }
+  { "audit",     MH_OPT_ARG, "audit-file" },
+  { "noaudit" },
+  { "changecur", MH_OPT_BOOL },
+  { "file",      MH_OPT_ARG, "input-file" },
+  { "form",      MH_OPT_ARG, "format-file" },
+  { "format",    MH_OPT_ARG, "string" },
+  { "truncate",  MH_OPT_BOOL },
+  { "width",     MH_OPT_ARG, "number" },
+  { "quiet" },
+  { NULL }
 };
 
 static char *format_str = mh_list_format;
diff --git a/mh/install-mh.c b/mh/install-mh.c
index 5b48244..8d33319 100644
--- a/mh/install-mh.c
+++ b/mh/install-mh.c
@@ -19,7 +19,6 @@
 
 static char doc[] = N_("GNU MH install-mh")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = "";
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -29,8 +28,8 @@ static struct argp_option options[] = {
 };
 
 struct mh_option mh_option[] = {
-  {"auto",     1, 0, },
-  {"compat",     1, 0, },
+  { "auto" },
+  { "compat" },
   { NULL }
 };
 
@@ -65,7 +64,7 @@ main (int argc, char **argv)
 
   mh_argp_init ();
   mh_auto_install = 0;
-  mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
+  mh_argp_parse (&argc, &argv, 0, options, mh_option, NULL, doc,
                 opt_handler, NULL, NULL);
 
   name = getenv ("MH");
diff --git a/mh/mark.c b/mh/mark.c
index ec2e46e..03588bf 100644
--- a/mh/mark.c
+++ b/mh/mark.c
@@ -19,7 +19,7 @@
 
 static char doc[] = N_("GNU MH mark")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = "[msgs...]";
+static char args_doc[] = N_("[MSGLIST]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -43,12 +43,12 @@ static struct argp_option options[] = {
 };
 
 struct mh_option mh_option[] = {
-  {"sequence", 1, },
-  {"add", 1, }, 
-  {"delete", 1, },
-  {"list", 1, },
-  {"public", 1, MH_OPT_BOOL },
-  {"zero", 1, MH_OPT_BOOL },
+  { "sequence" },
+  { "add" }, 
+  { "delete" },
+  { "list" },
+  { "public", MH_OPT_BOOL },
+  { "zero", MH_OPT_BOOL },
   { NULL }
 };
 
diff --git a/mh/mh_argp.c b/mh/mh_argp.c
index dff019b..b1b8d4b 100644
--- a/mh/mh_argp.c
+++ b/mh/mh_argp.c
@@ -180,7 +180,7 @@ struct argp mu_debug_argp = {
 };
 
 struct argp_child mh_argp_children[] = {
-  { &mu_debug_argp, 0, N_("Global debugging settings"), 0 },
+  { &mu_debug_argp, 0, N_("Global debugging settings"), -2 },
   { NULL }
 };
 
@@ -201,7 +201,8 @@ mh_argp_parse (int *pargc, char **pargv[],
 
   mu_set_program_name ((*pargv)[0]);
   mh_init ();
-  
+
+  mh_option_init (mh_option);
   memset (&argp, 0, sizeof (argp));
   argp.options = option;
   argp.parser = parse_opt;
diff --git a/mh/mh_getopt.c b/mh/mh_getopt.c
index a90d943..2bed55c 100644
--- a/mh/mh_getopt.c
+++ b/mh/mh_getopt.c
@@ -153,6 +153,52 @@ mh_help (struct mh_option *mh_opt, const char *doc)
             mu_program_name);
 }
 
+
+static int
+optcmp (const void *a, const void *b)
+{
+  struct mh_option const *opta = a, *optb = b;
+  return strcmp (opta->opt, optb->opt);
+}
+
+void
+mh_option_init (struct mh_option *opt)
+{
+  size_t count, i;
+
+  /* Count number of elements and initialize minimum abbreviation
+     lengths to 1. */
+  for (count = 0; opt[count].opt; count++)
+    opt[count].match_len = 1;
+  /* Sort them alphabetically */
+  qsort (opt, count, sizeof (opt[0]), optcmp);
+  /* Determine minimum abbreviations */
+  for (i = 0; i < count; i++)
+    {
+      const char *sample = opt[i].opt;
+      size_t sample_len = strlen (sample);
+      size_t minlen = opt[i].match_len;
+      size_t j;
+      
+      for (j = i + 1; j < count; j++)
+       {
+         size_t len = strlen (opt[j].opt);
+         if (len >= minlen && memcmp (opt[j].opt, sample, minlen) == 0)
+           do
+             {
+               minlen++;
+               opt[j].match_len = minlen;
+               if (minlen == sample_len)
+                 break;
+             }
+           while (len >= minlen && memcmp (opt[j].opt, sample, minlen) == 0);
+         else
+           break;
+       }
+      opt[i].match_len = minlen;
+    }
+}
+
 void
 mh_opt_notimpl (const char *name)
 {
diff --git a/mh/mh_getopt.h b/mh/mh_getopt.h
index b66026c..7312250 100644
--- a/mh/mh_getopt.h
+++ b/mh/mh_getopt.h
@@ -25,9 +25,9 @@
 struct mh_option
 {
   char *opt;
-  int match_len;
   int flags;
   char *arg;
+  size_t match_len;
 };
 
 struct mh_argp_data
@@ -183,6 +183,8 @@ enum mh_arg {
 
 extern void (*mh_help_hook) (void);
 
+void mh_option_init (struct mh_option *opt);
+
 void mh_argp_init (void);
 void mh_argv_preproc (int argc, char **argv, struct mh_argp_data *data);
 int mh_getopt (int argc, char **argv, struct mh_option *mh_opt, const char 
*doc);
diff --git a/mh/mh_init.c b/mh/mh_init.c
index 7b2098f..9913a98 100644
--- a/mh/mh_init.c
+++ b/mh/mh_init.c
@@ -808,13 +808,12 @@ mh_install (char *name, int automode)
   else if ((st.st_mode & S_IFREG) || (st.st_mode & S_IFLNK)) 
     {
       mu_error(_("You already have an MH profile, use an editor to modify 
it"));
-      exit (0);
+      exit (1);
     }
   else
     {
-      mu_error(_("You already have file %s which is not a regular file or a 
symbolic link.\n"
-                "Please remove it and try again"),
-              name);
+      mu_error (_("You already have file %s which is not a regular file or a 
symbolic link."), name);
+      mu_error (_("Please remove it and try again"));
       exit (1);
     }
 }
diff --git a/mh/mhl.c b/mh/mhl.c
index 9b5abcb..1d6635f 100644
--- a/mh/mhl.c
+++ b/mh/mhl.c
@@ -23,7 +23,7 @@
 
 static char doc[] = N_("GNU MH mhl")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[files]");
+static char args_doc[] = N_("[FILE [FILE...]]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -50,13 +50,13 @@ static struct argp_option options[] = {
    
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  { "bell",       1,  MH_OPT_BOOL },
-  { "clear",      1,  MH_OPT_BOOL },
-  { "form",       1,  MH_OPT_ARG, "formatfile"},
-  { "width",      1,  MH_OPT_ARG, "number"},
-  { "length",     1,  MH_OPT_ARG, "number"},
-  { "moreproc",   1,  MH_OPT_ARG, "program"},
-  { "nomoreproc", 3, },
+  { "bell",       MH_OPT_BOOL },
+  { "clear",      MH_OPT_BOOL },
+  { "form",       MH_OPT_ARG, "formatfile"},
+  { "width",      MH_OPT_ARG, "number"},
+  { "length",     MH_OPT_ARG, "number"},
+  { "moreproc",   MH_OPT_ARG, "program"},
+  { "nomoreproc" },
   { NULL }
 };
 
diff --git a/mh/mhn.c b/mh/mhn.c
index 238761d..d66ef9b 100644
--- a/mh/mhn.c
+++ b/mh/mhn.c
@@ -27,82 +27,88 @@
 static char doc[] = N_("GNU MH mhn")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = "[msgs]";
+static char args_doc[] = N_("[MSGLIST]");
 
 static struct argp_option options[] = {
   {"folder",       ARG_FOLDER,       N_("FOLDER"), 0,
    N_("specify folder to operate upon"), 0},
   {"file",         ARG_FILE,         N_("FILE"),   0,
    N_("specify file to operate upon"), 0},
-  
-  {N_("MIME editing options"),   0,  NULL, OPTION_DOC,  NULL, 5},
+
+#define GRID 10
+  {N_("MIME editing options"),   0,  NULL, OPTION_DOC,  NULL, GRID},
   {"compose",      ARG_COMPOSE,      N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("compose the MIME message (default)"), 6},
-  {"nocompose",    ARG_NOCOMPOSE,    NULL, OPTION_HIDDEN, "", 6},
-  
-  {N_("Listing options"),   0,  NULL, OPTION_DOC,  NULL, 0},
+   N_("compose the MIME message (default)"), GRID+1},
+  {"nocompose",    ARG_NOCOMPOSE,    NULL, OPTION_HIDDEN, "", GRID+1},
+#undef GRID
+#define GRID 20  
+  {N_("Listing options"),   0,  NULL, OPTION_DOC,  NULL, GRID},
   {"list",         ARG_LIST,         N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("list the table of contents"), 11 },
-  {"nolist",       ARG_NOLIST,       NULL, OPTION_HIDDEN, "", 11 },
+   N_("list the table of contents"), GRID+1 },
+  {"nolist",       ARG_NOLIST,       NULL, OPTION_HIDDEN, "", GRID+1 },
   {"headers",      ARG_HEADER,       N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("print the banner above the listing"), 12},
-  {"noheaders",    ARG_NOHEADERS,    NULL, OPTION_HIDDEN, "", 12 },
+   N_("print the banner above the listing"), GRID+1 },
+  {"noheaders",    ARG_NOHEADERS,    NULL, OPTION_HIDDEN, "", GRID+1 },
   {"realsize",     ARG_REALSIZE,     N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("list the decoded sizes"), 12},
-  {"norealsize",   ARG_NOREALSIZE,   NULL, OPTION_HIDDEN, "", 12 },
-
-  {N_("Display options"),   0,  NULL, OPTION_DOC,  NULL, 20},
+   N_("list the decoded sizes"), GRID+1 },
+  {"norealsize",   ARG_NOREALSIZE,   NULL, OPTION_HIDDEN, "", GRID+1 },
+#undef GRID
+#define GRID 40
+  {N_("Display options"),   0,  NULL, OPTION_DOC,  NULL, GRID},
   {"show",         ARG_SHOW,         N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("display the contents of the messages"), 21},
-  {"noshow",       ARG_NOSHOW,       NULL, OPTION_HIDDEN, "", 21 },
+   N_("display the contents of the messages"), GRID+1},
+  {"noshow",       ARG_NOSHOW,       NULL, OPTION_HIDDEN, "", GRID+1 },
   {"serialonly",   ARG_SERIALONLY,   N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("* display messages serially"), 22},
-  {"noserialonly", ARG_NOSERIALONLY, NULL, OPTION_HIDDEN, "", 22 },
+   N_("* display messages serially"), GRID+1},
+  {"noserialonly", ARG_NOSERIALONLY, NULL, OPTION_HIDDEN, "", GRID+1 },
   {"form",         ARG_FORM,         N_("FILE"), 0,
-   N_("read mhl format from FILE"), 22},
+   N_("read mhl format from FILE"), GRID+1},
   {"pause",        ARG_PAUSE,        N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("pause prior to displaying content"), 22},
-  {"nopause",      ARG_NOPAUSE,      NULL, OPTION_HIDDEN, "", 22 },
-   
-  {N_("Saving options"),   0,  NULL, OPTION_DOC,  NULL, 30},
+   N_("pause prior to displaying content"), GRID+1},
+  {"nopause",      ARG_NOPAUSE,      NULL, OPTION_HIDDEN, "", GRID+1 },
+#undef GRID
+#define GRID 50
+  {N_("Saving options"),   0,  NULL, OPTION_DOC,  NULL, GRID},
   {"store",        ARG_STORE,        N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("store the contents of the messages on disk"), 31},
-  {"nostore",      ARG_NOSTORE,      NULL, OPTION_HIDDEN, "", 31 },
+   N_("write extracted message parts to disk"), GRID+1},
+  {"nostore",      ARG_NOSTORE,      NULL, OPTION_HIDDEN, "", GRID+1 },
   {"auto",         ARG_AUTO,         N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("use filenames from the content headers"), 31},
-  {"noauto",       ARG_NOAUTO,       NULL, OPTION_HIDDEN, "", 31 },
+   N_("use filenames from the content headers"), GRID+1},
+  {"noauto",       ARG_NOAUTO,       NULL, OPTION_HIDDEN, "", GRID+1 },
   {"charset",      ARG_CHARSET,      N_("NAME"), 0,
-   N_("use this charset to represent attachment file names"), 31},
-  
-  {N_("Other options"),    0,  NULL, OPTION_DOC,  NULL, 40},
+   N_("use this charset to represent attachment file names"), GRID+1},
+#undef GRID
+#define GRID 60
+  {N_("Other options"),    0,  NULL, OPTION_DOC,  NULL, GRID},
   {"part",         ARG_PART,         N_("PART"), 0,
-   N_("limit the scope of the operation to the given part"), 41},
+   N_("limit the scope of the operation to the given part"), GRID+1},
   {"type",         ARG_TYPE,         N_("CONTENT"), 0,
-   N_("operate on message part with given multipart content"), 41 },
+   N_("operate on message part with given multipart content"), GRID+1 },
   {"verbose",      ARG_VERBOSE,     N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("print additional information"), 41 },
-  {"noverbose",    ARG_NOVERBOSE,   NULL, OPTION_HIDDEN, "", 41 },
+   N_("print additional information"), GRID+1 },
+  {"noverbose",    ARG_NOVERBOSE,   NULL, OPTION_HIDDEN, "", GRID+1 },
   {"quiet",        ARG_QUIET, 0, 0,
-   N_("be quiet")},
+   N_("be quiet"), GRID+1},
+#undef GRID
   {NULL}
 };
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"file",          2, 0, "filename"},
-  {"list",          1, MH_OPT_BOOL, NULL},
-  {"headers",       1, MH_OPT_BOOL, NULL},
-  {"realsize",      1, MH_OPT_BOOL, NULL},
-  {"show",          2, MH_OPT_BOOL, NULL},
-  {"serialonly",    2, MH_OPT_BOOL, NULL},
-  {"form",          2, 0, "formfile"},
-  {"pause",         3, MH_OPT_BOOL, NULL},
-  {"store",         1, MH_OPT_BOOL, NULL},
-  {"auto",          1, MH_OPT_BOOL, NULL},
-  {"part",          3, 0, "part"},
-  {"type",          1, 0, "type"},
-  {"verbose",       1, MH_OPT_BOOL, NULL},
-  {NULL}
+  { "file",          MH_OPT_ARG, "filename" },
+  { "list",          MH_OPT_BOOL },
+  { "headers",       MH_OPT_BOOL },
+  { "realsize",      MH_OPT_BOOL },
+  { "show",          MH_OPT_BOOL },
+  { "serialonly",    MH_OPT_BOOL },
+  { "form",          MH_OPT_ARG, "formfile" },
+  { "pause",         MH_OPT_BOOL },
+  { "store",         MH_OPT_BOOL },
+  { "auto",          MH_OPT_BOOL },
+  { "part",          MH_OPT_ARG, "part" },
+  { "type",          MH_OPT_ARG, "type" },
+  { "verbose",       MH_OPT_BOOL },
+  { NULL }
 };
 
 typedef struct _msg_part *msg_part_t;
diff --git a/mh/mhparam.c b/mh/mhparam.c
index 9149c1c..1ca2aad 100644
--- a/mh/mhparam.c
+++ b/mh/mhparam.c
@@ -21,7 +21,7 @@
 
 static char doc[] = N_("GNU MH mhparam")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[components]");
+static char args_doc[] = N_("[COMPONENT [COMPONENT...]]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -34,9 +34,9 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  { "all", 1, 0 },
-  { "component", 1, MH_OPT_BOOL},
-  { 0 }
+  { "all" },
+  { "component", MH_OPT_BOOL },
+  { NULL }
 };
 
 static int display_all;
diff --git a/mh/mhpath.c b/mh/mhpath.c
index 5051418..f3b8256 100644
--- a/mh/mhpath.c
+++ b/mh/mhpath.c
@@ -21,7 +21,7 @@
 
 static char doc[] = N_("GNU MH mhpath")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[+folder] [msgs]");
+static char args_doc[] = N_("[+FOLDER] [MSGLIST]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -32,7 +32,7 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  { 0 }
+  { NULL }
 };
 
 static error_t
diff --git a/mh/pick.c b/mh/pick.c
index 91d202b..0bbf3ba 100644
--- a/mh/pick.c
+++ b/mh/pick.c
@@ -37,93 +37,106 @@ letter or followed by a colon, e.g.:\n\
   --user-agent: Mailutils\n\
 \n\
 Use -help to obtain a list of traditional MH options.");
-static char args_doc[] = N_("[messages]");
+static char args_doc[] = N_("[MSGLIST]");
 
 /* GNU options */
 static struct argp_option options[] = {
-  {"folder",  ARG_FOLDER, N_("FOLDER"), 0,
-   N_("specify folder to operate upon"), 0},
-
-  {N_("Specifying search patterns:"), 0,  NULL, OPTION_DOC,  NULL, 0},
-  {"component", ARG_COMPONENT, N_("FIELD"), 0,
-   N_("search the named header field"), 1},
-  {"pattern", ARG_PATTERN, N_("STRING"), 0,
-   N_("set pattern to look for"), 1},
-  {"search",  0, NULL, OPTION_ALIAS, NULL, 1},
-  {"cflags",  ARG_CFLAGS,  N_("STRING"), 0,
-   N_("flags controlling the type of regular expressions. STRING must consist 
of one or more of the following letters: B=basic, E=extended, I=ignore case, 
C=case sensitive. Default is \"EI\". The flags remain in effect until the next 
occurrence of --cflags option. The option must occur right before --pattern or 
--component option (or its alias).") },
-  {"cc",      ARG_CC,      N_("STRING"), 0,
-   N_("same as --component cc --pattern STRING"), 1},
-  {"date",    ARG_DATE,    N_("STRING"), 0,
-   N_("same as --component date --pattern STRING"), 1},
-  {"from",    ARG_FROM,    N_("STRING"), 0,
-   N_("same as --component from --pattern STRING"), 1},
-  {"subject", ARG_SUBJECT, N_("STRING"), 0,
-   N_("same as --component subject --pattern STRING"), 1},
-  {"to",      ARG_TO,      N_("STRING"), 0,
-   N_("same as --component to --pattern STRING"), 1},
-
-  {N_("Date constraint operations:"), 0,  NULL, OPTION_DOC, NULL, 1},
-  {"datefield",ARG_DATEFIELD, N_("STRING"), 0,
-   N_("search in the named date header field (default is `Date:')"), 2},
-  {"after",    ARG_AFTER,     N_("DATE"), 0,
-   N_("match messages after the given date"), 2},
-  {"before",   ARG_BEFORE,    N_("DATE"), 0,
-   N_("match messages before the given date"), 2},
-
-  {N_("Logical operations and grouping:"), 0, NULL, OPTION_DOC, NULL, 2},
-  {"and",     ARG_AND,    NULL, 0,
-   N_("logical AND (default)"), 3 },
-  {"or",      ARG_OR,     NULL, 0,
-   N_("logical OR"), 3 },
-  {"not",     ARG_NOT,    NULL, 0,
-   N_("logical NOT"), 3},
-  {"lbrace",  ARG_LBRACE, NULL, 0,
-   N_("open group"), 3},
-  {"(",       0, NULL, OPTION_ALIAS, NULL, 3},
-  {"rbrace",  ARG_RBRACE, NULL, 0,
-   N_("close group"), 3},
-  {")",       0, NULL, OPTION_ALIAS, NULL, 3},
-
-  {N_("Operations over the selected messages:"), 0, NULL, OPTION_DOC, NULL, 3},
-  {"list",   ARG_LIST,       N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("list the numbers of the selected messages (default)"), 4},
-  {"nolist", ARG_NOLIST,     NULL, OPTION_HIDDEN, "", 4 },
-  {"sequence", ARG_SEQUENCE,  N_("NAME"), 0,
-   N_("add matching messages to the given sequence"), 4},
-  {"public", ARG_PUBLIC, N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("create public sequence"), 4},
-  {"nopublic", ARG_NOPUBLIC, NULL, OPTION_HIDDEN, "", 4 },
-  {"zero",     ARG_ZERO,     N_("BOOL"), OPTION_ARG_OPTIONAL,
-   N_("empty the sequence before adding messages"), 4},
-  {"nozero", ARG_NOZERO, NULL, OPTION_HIDDEN, "", 4 },
-  {NULL},
+#define GRID 10
+  { "folder",  ARG_FOLDER, N_("FOLDER"), 0,
+    N_("specify folder to operate upon"), GRID },
+#undef GRID
+
+#define GRID 20
+  { N_("Search patterns"), 0,  NULL, OPTION_DOC,  NULL, GRID },
+  { "component", ARG_COMPONENT, N_("FIELD"), 0,
+    N_("search the named header field"), GRID+1},
+  { "pattern", ARG_PATTERN, N_("STRING"), 0,
+    N_("set pattern to look for"), GRID+1 },
+  { "search",  0, NULL, OPTION_ALIAS, NULL, GRID+1 },
+  { "cflags",  ARG_CFLAGS,  N_("STRING"), 0,
+    N_("flags controlling the type of regular expressions. STRING must consist 
of one or more of the following letters: B=basic, E=extended, I=ignore case, 
C=case sensitive. Default is \"EI\". The flags remain in effect until the next 
occurrence of --cflags option. The option must occur right before --pattern or 
--component option (or its alias)."), GRID+1 },
+  { "cc",      ARG_CC,      N_("STRING"), 0,
+    N_("same as --component cc --pattern STRING"), GRID+1 },
+  { "date",    ARG_DATE,    N_("STRING"), 0,
+    N_("same as --component date --pattern STRING"), GRID+1 },
+  { "from",    ARG_FROM,    N_("STRING"), 0,
+    N_("same as --component from --pattern STRING"), GRID+1 },
+  { "subject", ARG_SUBJECT, N_("STRING"), 0,
+    N_("same as --component subject --pattern STRING"), GRID+1 },
+  { "to",      ARG_TO,      N_("STRING"), 0,
+    N_("same as --component to --pattern STRING"), GRID+1 },
+#undef GRID
+
+#define GRID 30  
+  { N_("Date constraint operations"), 0,  NULL, OPTION_DOC, NULL, GRID },
+  { "datefield",ARG_DATEFIELD, N_("STRING"), 0,
+    N_("search in the named date header field (default is `Date:')"), GRID+1 },
+  { "after",    ARG_AFTER,     N_("DATE"), 0,
+    N_("match messages after the given date"), GRID+1 },
+  { "before",   ARG_BEFORE,    N_("DATE"), 0,
+    N_("match messages before the given date"), GRID+1 },
+#undef GRID
+
+#define GRID 40
+  { N_("Logical operations and grouping"), 0, NULL, OPTION_DOC, NULL, GRID },
+  { "and",     ARG_AND,    NULL, 0,
+    N_("logical AND (default)"), GRID+1 },
+  { "or",      ARG_OR,     NULL, 0,
+    N_("logical OR"), GRID+1 },
+  { "not",     ARG_NOT,    NULL, 0,
+    N_("logical NOT"), GRID+1 },
+  { "lbrace",  ARG_LBRACE, NULL, 0,
+    N_("open group"), GRID+1 },
+  { "(",       0, NULL, OPTION_ALIAS, NULL, GRID+1 },
+  { "rbrace",  ARG_RBRACE, NULL, 0,
+    N_("close group"), GRID+1},
+  { ")",       0, NULL, OPTION_ALIAS, NULL, GRID+1 },
+#undef GRID
+
+#define GRID 50
+  { N_("Operations over the selected messages"), 0, NULL, OPTION_DOC, NULL,
+    GRID },
+  { "list",   ARG_LIST,       N_("BOOL"), OPTION_ARG_OPTIONAL,
+    N_("list the numbers of the selected messages (default)"), GRID+1 },
+  { "nolist", ARG_NOLIST,     NULL, OPTION_HIDDEN, "", GRID+1 },
+  { "sequence", ARG_SEQUENCE,  N_("NAME"), 0,
+    N_("add matching messages to the given sequence"), GRID+1 },
+  { "public", ARG_PUBLIC, N_("BOOL"), OPTION_ARG_OPTIONAL,
+    N_("create public sequence"), GRID+1 },
+  { "nopublic", ARG_NOPUBLIC, NULL, OPTION_HIDDEN, "", GRID+1 },
+  { "zero",     ARG_ZERO,     N_("BOOL"), OPTION_ARG_OPTIONAL,
+    N_("empty the sequence before adding messages"), GRID+1 },
+  { "nozero", ARG_NOZERO, NULL, OPTION_HIDDEN, "", GRID+1 },
+#undef GRID
+
+  { NULL }
+  
 };
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"component", 1,  0, "field" },
-  {"pattern",   1,  0, "pattern" },
-  {"search",    1,  0, "pattern" },
-  {"cc",        1,  0, "pattern" },
-  {"date",      1,  0, "pattern" },
-  {"from",      1,  0, "pattern" },
-  {"subject",   1,  0, "pattern" },
-  {"to",        1,  0, "pattern" },
-  {"datefield", 1,  0, "field" },
-  {"after",     1,  0, "date" },
-  {"before",    1,  0, "date"},
-  {"and",       1,  0, NULL },
-  {"or",        1,  0, NULL }, 
-  {"not",       1,  0, NULL },
-  {"lbrace",    1,  0, NULL },
-  {"rbrace",    1,  0, NULL },
-
-  {"list",      1,  MH_OPT_BOOL, },
-  {"sequence",  1,  0, NULL },
-  {"public",    1,  MH_OPT_BOOL },
-  {"zero",      1,  MH_OPT_BOOL },
-  {NULL}
+  { "component", MH_OPT_ARG, "field" },
+  { "pattern",   MH_OPT_ARG, "pattern" },
+  { "search",    MH_OPT_ARG, "pattern" },
+  { "cc",        MH_OPT_ARG, "pattern" },
+  { "date",      MH_OPT_ARG, "pattern" },
+  { "from",      MH_OPT_ARG, "pattern" },
+  { "subject",   MH_OPT_ARG, "pattern" },
+  { "to",        MH_OPT_ARG, "pattern" },
+  { "datefield", MH_OPT_ARG, "field" },
+  { "after",     MH_OPT_ARG, "date" },
+  { "before",    MH_OPT_ARG, "date" },
+  { "and" },
+  { "or" }, 
+  { "not" },
+  { "lbrace" },
+  { "rbrace" },
+
+  { "list",      MH_OPT_BOOL },
+  { "sequence",  MH_OPT_ARG, "name" },
+  { "public",    MH_OPT_BOOL },
+  { "zero",      MH_OPT_BOOL },
+  { NULL }
 };
 
 static int list = 1;
diff --git a/mh/refile.c b/mh/refile.c
index ab66730..74d47c7 100644
--- a/mh/refile.c
+++ b/mh/refile.c
@@ -27,7 +27,7 @@
 static char doc[] = N_("GNU MH refile")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("messages folder [folder...]");
+static char args_doc[] = N_("MSGLIST FOLDER [FOLDER...]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -49,12 +49,12 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"file",     2, 0, "input-file"},
-  {"draft",    1, 0, NULL },
-  {"link",     1, MH_OPT_BOOL, NULL },
-  {"preserve", 1, MH_OPT_BOOL, NULL },
-  {"src",      1, 0, "+folder" },
-  { 0 }
+  { "file",     MH_OPT_ARG, "input-file"},
+  { "draft" },
+  { "link",     MH_OPT_BOOL },
+  { "preserve", MH_OPT_BOOL },
+  { "src",      MH_OPT_ARG, "folder" },
+  { NULL }
 };
 
 int link_flag = 0;
diff --git a/mh/repl.c b/mh/repl.c
index 920c4d6..6a9d496 100644
--- a/mh/repl.c
+++ b/mh/repl.c
@@ -25,7 +25,7 @@
 static char doc[] = N_("GNU MH repl")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[+folder] [msg]");
+static char args_doc[] = N_("[+FOLDER] [MESSAGE]");
 
 
 /* GNU options */
@@ -70,26 +70,26 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"annotate",    1, MH_OPT_BOOL },
-  {"build",       1, },
-  {"cc",          1, MH_OPT_ARG, "all/to/cc/me"},
-  {"nocc",        3, MH_OPT_ARG, "all/to/cc/me"},
-  {"form",        4, MH_OPT_ARG, "formatfile"},
-  {"width",       1, MH_OPT_ARG, "number"},
-  {"draftfolder", 6, MH_OPT_ARG, "folder"},
-  {"nodraftfolder", 3 },
-  {"draftmessage", 6, },
-  {"editor",      1, MH_OPT_ARG, "program"},
-  {"noedit",      3, },
-  {"fcc",         1, MH_OPT_ARG, "folder"},
-  {"filter",      2, MH_OPT_ARG, "program"},
-  {"format",      2, MH_OPT_BOOL },
-  {"group",       1, MH_OPT_BOOL },
-  {"inplace",     1, MH_OPT_BOOL },
-  {"query",       1, MH_OPT_BOOL },
-  {"whatnowproc", 2, MH_OPT_ARG, "program"},
-  {"nowhatnowproc", 3 },
-  { 0 }
+  { "annotate",    MH_OPT_BOOL },
+  { "build" },
+  { "cc",          MH_OPT_ARG, "all/to/cc/me"},
+  { "nocc",        MH_OPT_ARG, "all/to/cc/me"},
+  { "form",        MH_OPT_ARG, "formatfile"},
+  { "width",       MH_OPT_ARG, "number"},
+  { "draftfolder", MH_OPT_ARG, "folder"},
+  { "nodraftfolder" },
+  { "draftmessage" },
+  { "editor", MH_OPT_ARG, "program"},
+  { "noedit" },
+  { "fcc",         MH_OPT_ARG, "folder"},
+  { "filter",      MH_OPT_ARG, "program"},
+  { "format",      MH_OPT_BOOL },
+  { "group",       MH_OPT_BOOL },
+  { "inplace",     MH_OPT_BOOL },
+  { "query",       MH_OPT_BOOL },
+  { "whatnowproc", MH_OPT_ARG, "program"},
+  { "nowhatnowproc" },
+  { NULL }
 };
 
 static char default_format_str[] =
diff --git a/mh/rmf.c b/mh/rmf.c
index 8a2c60a..bf07fe4 100644
--- a/mh/rmf.c
+++ b/mh/rmf.c
@@ -30,7 +30,7 @@
 
 static char doc[] = N_("GNU MH rmf")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[+folder]");
+static char args_doc[] = N_("[+FOLDER]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -47,7 +47,7 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"interactive", 1, MH_OPT_BOOL, NULL},
+  { "interactive", MH_OPT_BOOL },
   { 0 }
 };
 
diff --git a/mh/rmm.c b/mh/rmm.c
index a9bbfc8..96cb028 100644
--- a/mh/rmm.c
+++ b/mh/rmm.c
@@ -21,7 +21,7 @@
 
 static char doc[] = N_("GNU MH rmm")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[+folder] [msgs]");
+static char args_doc[] = N_("[+FOLDER] [MSGLIST]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -32,7 +32,7 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  { 0 }
+  { NULL }
 };
 
 static error_t
diff --git a/mh/scan.c b/mh/scan.c
index 3bc3816..0fe0ee4 100644
--- a/mh/scan.c
+++ b/mh/scan.c
@@ -28,7 +28,7 @@
 
 static char doc[] = N_("GNU MH scan")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[+folder] [msgs]");
+static char args_doc[] = N_("[+FOLDER] [MSGLIST]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -56,14 +56,14 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"clear",   1,  MH_OPT_BOOL},
-  {"form",    4,  MH_OPT_ARG, "formatfile"},
-  {"format",  5,  MH_OPT_ARG, "string"},
-  {"header",  3,  MH_OPT_BOOL},
-  {"width",   1,  MH_OPT_ARG, "number"},
-  {"reverse", 1,  MH_OPT_BOOL},
-  {"file",    4,  MH_OPT_ARG, "file"},
-  { 0 }
+  { "clear",   MH_OPT_BOOL },
+  { "form",    MH_OPT_ARG, "formatfile" },
+  { "format",  MH_OPT_ARG, "string" },
+  { "header",  MH_OPT_BOOL },
+  { "width",   MH_OPT_ARG, "number" },
+  { "reverse", MH_OPT_BOOL },
+  { "file",    MH_OPT_ARG, "file" },
+  { NULL }
 };
 
 static int clear;
diff --git a/mh/send.c b/mh/send.c
index faece4e..d717bb9 100644
--- a/mh/send.c
+++ b/mh/send.c
@@ -26,7 +26,7 @@
 static char doc[] = N_("GNU MH send")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("file [file...]");
+static char args_doc[] = N_("FILE [FILE...]");
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -79,25 +79,25 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"alias",         1, 0, "aliasfile" },
-  {"draft",         5, 0, NULL },
-  {"draftfolder",   6, 0, "folder" },
-  {"draftmessage",  6, 0, "message"},
-  {"nodraftfolder", 3, 0, NULL },
-  {"filter",        2, 0, "filterfile"},
-  {"nofilter",      3, 0, NULL },
-  {"format",        4, MH_OPT_BOOL, NULL},
-  {"forward",       4, MH_OPT_BOOL, NULL},
-  {"mime",          2, MH_OPT_BOOL, NULL},
-  {"msgid",         2, MH_OPT_BOOL, NULL},
-  {"push",          2, MH_OPT_BOOL, NULL},
-  {"preserve",      2, MH_OPT_BOOL, NULL},
-  {"keep",          1, MH_OPT_BOOL, NULL},
-  {"split",         1, 0, "seconds"},
-  {"verbose",       1, MH_OPT_BOOL, NULL},
-  {"watch",         2, MH_OPT_BOOL, NULL},
-  {"width",         2, 0, NULL },
-  { 0 }
+  { "alias",         MH_OPT_ARG, "aliasfile" },
+  { "draft" },
+  { "draftfolder",   MH_OPT_ARG, "folder" },
+  { "draftmessage",  MH_OPT_ARG, "message" },
+  { "nodraftfolder" },
+  { "filter",        MH_OPT_ARG, "filterfile" },
+  { "nofilter" },
+  { "format",        MH_OPT_BOOL },
+  { "forward",       MH_OPT_BOOL },
+  { "mime",          MH_OPT_BOOL },
+  { "msgid",         MH_OPT_BOOL },
+  { "push",          MH_OPT_BOOL },
+  { "preserve",      MH_OPT_BOOL },
+  { "keep",          MH_OPT_BOOL },
+  { "split",         MH_OPT_ARG, "seconds" },
+  { "verbose",       MH_OPT_BOOL },
+  { "watch",         MH_OPT_BOOL },
+  { "width" },
+  { NULL }
 };
 
 static int use_draft;            /* Use the prepared draft */
diff --git a/mh/sortm.c b/mh/sortm.c
index 1e5bacc..45ad51b 100644
--- a/mh/sortm.c
+++ b/mh/sortm.c
@@ -24,7 +24,7 @@
 
 static char doc[] = N_("GNU MH sortm")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = N_("[msgs]");
+static char args_doc[] = N_("[MSGLIST]");
 
 #define ARG_QUICKSORT 1024
 #define ARG_SHELL     1025
@@ -78,13 +78,13 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"datefield",     1, 0, "field" },
-  {"nodatefield",   3, 0, 0 },
-  {"textfield",     1, 0, "field" },
-  {"notextfield",   3, 0, 0 },
-  {"limit",         1, 0, "days" },
-  {"nolimit",       3, 0, 0 },
-  {"verbose",       1, MH_OPT_BOOL, NULL},
+  { "datefield",     MH_OPT_ARG, "field" },
+  { "nodatefield" },
+  { "textfield",     MH_OPT_ARG, "field" },
+  { "notextfield" },
+  { "limit",         MH_OPT_ARG, "days" },
+  { "nolimit" },
+  { "verbose",       MH_OPT_BOOL },
   { NULL },
 };
 
diff --git a/mh/tests/Makefile.am b/mh/tests/Makefile.am
index 2006a35..7429b7a 100644
--- a/mh/tests/Makefile.am
+++ b/mh/tests/Makefile.am
@@ -42,10 +42,12 @@ TESTSUITE_AT = \
  anno.at\
  folder.at\
  inc.at\
+ install-mh.at\
  mark.at\
  mhl.at\
  mhparam.at\
  mhpath.at\
+ pick.at\
  scan.at\
  refile.at\
  rmf.at\
diff --git a/mh/tests/install-mh.at b/mh/tests/install-mh.at
new file mode 100644
index 0000000..05abaae
--- /dev/null
+++ b/mh/tests/install-mh.at
@@ -0,0 +1,63 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+AT_SETUP([install-mh -auto])
+AT_KEYWORDS([install-mh install-mh00])
+
+AT_CHECK([
+mkdir home
+dir=`cd home; pwd`
+HOME=$dir MH=$dir/mh_profile install-mh -auto || exit $?
+find home
+HOME=$dir MH=$dir/mh_profile install-mh -auto 2>errout
+echo $?
+cat errout
+],
+[0],
+[I'm going to create the standard MH path for you.
+home
+home/Mail
+home/Mail/context
+home/Mail/inbox
+home/mh_profile
+1
+install-mh: You already have an MH profile, use an editor to modify it
+])
+
+AT_CLEANUP
+
+# --------------------------------------------------
+AT_SETUP([install-mh with invalid profile])
+AT_KEYWORDS([install-mh install-mh01])
+
+AT_CHECK([
+mkdir home
+dir=`cd home; pwd`
+mkdir $dir/mh_profile
+HOME=$dir MH=$dir/mh_profile install-mh -auto 2>errout
+code=$?
+cat errout | sed 's|[[^ ][^ ]*]/mh_profile|mh_profile|' >&2
+exit $code
+],
+[1],
+[],
+[install-mh: You already have file mh_profile which is not a regular file or a 
symbolic link.
+install-mh: Please remove it and try again
+])
+
+AT_CLEANUP
+
+# End of install-mh.at
diff --git a/mh/tests/pick.at b/mh/tests/pick.at
new file mode 100644
index 0000000..7658e3f
--- /dev/null
+++ b/mh/tests/pick.at
@@ -0,0 +1,313 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+m4_pushdef[MH_KEYWORDS],[pick])
+
+MH_CHECK([pick -from],[pick00 pick-from],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -from dormouse
+],
+[0],
+[17
+31
+49
+61
+65
+67
+69
+77
+79
+81
+83
+88
+89
+91
+92
+])
+
+MH_CHECK([pick -from -sequence],[pick01 pick-from-sequence],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -from dormouse -sequence dormouse || exit $?
+sed -n '/^dormouse:/{s/  */ /g;s/ $//;p}' Mail/inbox/.mh_sequences
+],
+[0],
+[dormouse: 17 31 49 61 65 67 69 77 79 81 83 88 89 91 92
+])
+
+MH_CHECK([pick -search],[pick02 pick-search],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -search 'Why not'
+],
+[0],
+[91
+])
+
+MH_CHECK([pick -search regex],[pick03 pick-search-regex],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -search 'I.*think'
+],
+[0],
+[36
+86
+93
+])
+
+MH_CHECK([pick -subject -from],[pick04 pick-subject-from],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -subject Story -from Dormouse
+],
+[0],
+[61
+65
+67
+69
+77
+79
+81
+83
+88
+89
+91
+92
+])
+
+MH_CHECK([pick -subject -and -from],[pick05 pick-subject-and-from],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -subject Story -and -from Dormouse
+],
+[0],
+[61
+65
+67
+69
+77
+79
+81
+83
+88
+89
+91
+92
+])
+
+MH_CHECK([pick -subject -or -from],[pick06 pick-subject-or-from],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -subject Story -or -from Dormouse
+],
+[0],
+[17
+31
+49
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+76
+77
+78
+79
+80
+81
+82
+83
+85
+86
+87
+88
+89
+90
+91
+92
+93
+])
+
+MH_CHECK([pick -- default precedence],[pick07 pick-subject-and-from-or-from],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -subject Story -and -from Dormouse -or -from Alice
+],
+[0],
+[2
+4
+6
+8
+10
+12
+14
+20
+25
+27
+29
+33
+36
+38
+40
+43
+45
+47
+51
+53
+55
+57
+59
+61
+63
+65
+66
+67
+68
+69
+70
+72
+74
+76
+77
+78
+79
+80
+81
+82
+83
+85
+87
+88
+89
+90
+91
+92
+93
+95
+])
+
+MH_CHECK([pick -- explicit precedence (1)],[pick08 pick-expl-1],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -lbrace -subject Story -and -from Dormouse -rbrace -or -from Alice
+],
+[0],
+[2
+4
+6
+8
+10
+12
+14
+20
+25
+27
+29
+33
+36
+38
+40
+43
+45
+47
+51
+53
+55
+57
+59
+61
+63
+65
+66
+67
+68
+69
+70
+72
+74
+76
+77
+78
+79
+80
+81
+82
+83
+85
+87
+88
+89
+90
+91
+92
+93
+95
+])
+
+MH_CHECK([pick -- explicit precedence (2)],[pick09 pick-expl-2],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+echo "cur: 1" > Mail/inbox/.mh_sequences
+pick -subject Story -and -lbrace -from Dormouse -or -from Alice -rbrace
+],
+[0],
+[59
+61
+63
+65
+66
+67
+68
+69
+70
+76
+77
+78
+79
+80
+81
+82
+83
+85
+87
+88
+89
+90
+91
+92
+93
+])
+
+m4_popdef[MH_KEYWORDS])
+# End of pick.at
diff --git a/mh/tests/testsuite.at b/mh/tests/testsuite.at
index 86bc7ba..bf19a5b 100644
--- a/mh/tests/testsuite.at
+++ b/mh/tests/testsuite.at
@@ -41,6 +41,7 @@ AT_CLEANUP
 
 AT_INIT
 
+m4_include([install-mh.at])
 m4_include([folder.at])
 m4_include([inc.at])
 m4_include([scan.at])
@@ -52,3 +53,4 @@ m4_include([refile.at])
 m4_include([mhpath.at])
 m4_include([mhl.at])
 m4_include([anno.at])
+m4_include([pick.at])
diff --git a/mh/whatnow.c b/mh/whatnow.c
index decf947..aa47a8c 100644
--- a/mh/whatnow.c
+++ b/mh/whatnow.c
@@ -38,13 +38,13 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"draftfolder", 6, MH_OPT_ARG, "folder"},
-  {"nodraftfolder", 3, },
-  {"draftmessage", 6, },
-  {"editor", 1, MH_OPT_ARG, "program"},
-  {"noedit", 3, },
-  {"prompt", 1 },
-  { 0 }
+  { "draftfolder",  MH_OPT_ARG, "folder" },
+  { "nodraftfolder" },
+  { "draftmessage" },
+  { "editor",       MH_OPT_ARG, "program" },
+  { "noedit" },
+  { "prompt" },
+  { NULL }
 };
 
 struct mh_whatnow_env wh_env = { 0 };
diff --git a/mh/whom.c b/mh/whom.c
index b943e97..5fb719e 100644
--- a/mh/whom.c
+++ b/mh/whom.c
@@ -19,7 +19,7 @@
 
 static char doc[] = N_("GNU MH whom")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
-static char args_doc[] = "[file]";
+static char args_doc[] = "[FILE]";
 
 /* GNU options */
 static struct argp_option options[] = {
@@ -42,12 +42,12 @@ static struct argp_option options[] = {
 
 /* Traditional MH options */
 struct mh_option mh_option[] = {
-  {"alias",         1, 0, "aliasfile" },
-  {"draft",         5, 0, NULL },
-  {"draftfolder",   6, 0, "folder" },
-  {"draftmessage",  6, 0, "message"},
-  {"nodraftfolder", 3, 0, NULL },
-  {"check",         1, MH_OPT_BOOL, NULL},
+  { "alias",         MH_OPT_ARG, "aliasfile" },
+  { "draft" },
+  { "draftfolder",   MH_OPT_ARG, "folder" },
+  { "draftmessage",  MH_OPT_ARG, "message" },
+  { "nodraftfolder" },
+  { "check",         MH_OPT_BOOL },
   {NULL}
 };
 


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]