Removed the draft message in favor for a consistent draft folder facility
[mmh] / uip / whatnowsbr.c
index c0f331a..f8b7223 100644 (file)
 #include <h/utils.h>
 
 static struct swit whatnowswitches[] = {
-#define DFOLDSW  0
-       { "draftfolder +folder", 0 },
-#define DMSGSW  1
-       { "draftmessage msg", 0 },
-#define NDFLDSW  2
-       { "nodraftfolder", 0 },
-#define EDITRSW  3
+#define EDITRSW  0
        { "editor editor", 0 },
-#define NEDITSW  4
+#define NEDITSW  1
        { "noedit", 0 },
-#define PRMPTSW  5
+#define PRMPTSW  2
        { "prompt string", 4 },
-#define VERSIONSW  6
+#define VERSIONSW  3
        { "version", 0 },
-#define HELPSW  7
+#define HELPSW  4
        { "help", 0 },
-#define ATTACHSW  8
+#define ATTACHSW  5
        { "attach header-field-name", 0 },
        { NULL, 0 }
 };
@@ -83,21 +77,21 @@ static struct swit aleqs[] = {
        { "send [<switches>]", 0 },
 #define PUSHSW  6
        { "push [<switches>]", 0 },
-#define QUITSW  8
+#define QUITSW  7
        { "quit [-delete]", 0 },
-#define DELETESW  9
+#define DELETESW  8
        { "delete", 0 },
-#define CDCMDSW  10
+#define CDCMDSW  9
        { "cd [directory]", 0 },
-#define PWDCMDSW  11
+#define PWDCMDSW  10
        { "pwd", 0 },
-#define LSCMDSW  12
+#define LSCMDSW  11
        { "ls", 0 },
-#define ATTACHCMDSW  13
+#define ATTACHCMDSW  12
        { "attach", 0 },
-#define DETACHCMDSW  14
+#define DETACHCMDSW  13
        { "detach [-n]", 2 },
-#define ALISTCMDSW  15
+#define ALISTCMDSW  14
        { "alist [-ln] ", 2 },
        { NULL, 0 }
 };
@@ -128,8 +122,8 @@ static int copyf (char *, char *);
 int
 WhatNow (int argc, char **argv)
 {
-       int isdf = 0, nedit = 0, use = 0;
-       char *cp, *dfolder = NULL, *dmsg = NULL;
+       int nedit = 0, use = 0;
+       char *cp;
        char *ed = NULL, *drft = NULL, *msgnam = NULL;
        char buf[BUFSIZ], prompt[BUFSIZ];
        char **argp, **arguments;
@@ -175,25 +169,6 @@ WhatNow (int argc, char **argv)
                                print_version(invo_name);
                                done (1);
 
-                       case DFOLDSW:
-                               if (dfolder)
-                                       adios (NULL, "only one draft folder at a time!");
-                               if (!(cp = *argp++) || *cp == '-')
-                                       adios (NULL, "missing argument to %s", argp[-2]);
-                               dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
-                                       *cp != '@' ? TFOLDER : TSUBCWF);
-                               continue;
-                       case DMSGSW:
-                               if (dmsg)
-                                       adios (NULL, "only one draft message at a time!");
-                               if (!(dmsg = *argp++) || *dmsg == '-')
-                                       adios (NULL, "missing argument to %s", argp[-2]);
-                               continue;
-                       case NDFLDSW:
-                               dfolder = NULL;
-                               isdf = NOTOK;
-                               continue;
-
                        case EDITRSW:
                                if (!(ed = *argp++) || *ed == '-')
                                        adios (NULL, "missing argument to %s", argp[-2]);
@@ -223,7 +198,7 @@ WhatNow (int argc, char **argv)
        }
 
        if ((drft == NULL && (drft = getenv ("mhdraft")) == NULL) || *drft == 0)
-               drft = getcpy (m_draft (dfolder, dmsg, 1, &isdf));
+               drft = getcpy (m_draft("cur"));
 
        msgnam = (cp = getenv ("mhaltmsg")) && *cp ? getcpy (cp) : NULL;
 
@@ -1009,53 +984,47 @@ static struct swit  sendswitches[] = {
        { "push", 0 },
 #define NSPSHSW  13
        { "nopush", 0 },
-#define UNIQSW  15
+#define UNIQSW  14
        { "unique", -6 },
-#define NUNIQSW  16
+#define NUNIQSW  15
        { "nounique", -8 },
-#define VERBSW  17
+#define VERBSW  16
        { "verbose", 0 },
-#define NVERBSW  18
+#define NVERBSW  17
        { "noverbose", 0 },
-#define WATCSW  19
+#define WATCSW  18
        { "watch", 0 },
-#define NWATCSW  20
+#define NWATCSW  19
        { "nowatch", 0 },
-#define WIDTHSW  21
+#define WIDTHSW  20
        { "width columns", 0 },
-#define SVERSIONSW  22
+#define SVERSIONSW  21
        { "version", 0 },
-#define SHELPSW  23
+#define SHELPSW  22
        { "help", 0 },
-#define BITSTUFFSW  24
+#define BITSTUFFSW  23
        { "dashstuffing", -12 },
-#define NBITSTUFFSW  25
+#define NBITSTUFFSW  24
        { "nodashstuffing", -14 },
-#define MAILSW  26
+#define MAILSW  25
        { "mail", -4 },
-#define SAMLSW  27
+#define SAMLSW  26
        { "saml", -4 },
-#define SSNDSW  28
+#define SSNDSW  27
        { "send", -4 },
-#define SOMLSW  29
+#define SOMLSW  28
        { "soml", -4 },
-#define CLIESW  30
+#define CLIESW  29
        { "client host", -6 },
-#define SERVSW  31
+#define SERVSW  30
        { "server host", 6 },
-#define SNOOPSW  32
+#define SNOOPSW  31
        { "snoop", -5 },
-#define SDRFSW  33
-       { "draftfolder +folder", -6 },
-#define SDRMSW  34
-       { "draftmessage msg", -6 },
-#define SNDRFSW  35
-       { "nodraftfolder", -3 },
-#define SNDATTACHSW  39
+#define SNDATTACHSW  32
        { "attach file", 6 },
-#define SNDATTACHFORMAT   40
+#define SNDATTACHFORMAT   33
        { "attachformat", 7 },
-#define PORTSW  41
+#define PORTSW  34
        { "port server-port-name/number", 4 },
        { NULL, 0 }
 };
@@ -1219,15 +1188,6 @@ sendit (char *sp, char **arg, char *file, int pushed)
                                        vec[vecp++] = cp;
                                        continue;
 
-                               case SDRFSW:
-                               case SDRMSW:
-                                       if (!(cp = *argp++) || *cp == '-') {
-                                               advise (NULL, "missing argument to %s", argp[-2]);
-                                               return;
-                                       }
-                               case SNDRFSW:
-                                       continue;
-
                                case SNDATTACHSW:
                                        if (!(attach = *argp++) || *attach == '-') {
                                                advise (NULL, "missing argument to %s", argp[-2]);