Remove verbosity for -noverbose; cleanup in code layout and message texts
authormarkus schnalke <meillo@marmaro.de>
Wed, 14 Jan 2015 06:53:31 +0000 (07:53 +0100)
committermarkus schnalke <meillo@marmaro.de>
Wed, 14 Jan 2015 06:53:31 +0000 (07:53 +0100)
We shouldn't print information messages if we run non-verbosely.
In this case, the message appeared not to be helpful because it
suggests to re-run the command with `-verbose' ... but sending the
message again is usually not possible, not wanted or would produce
different results.

This is a cleanup of Philipp's patch.

uip/send.c

index 3ca6772..c2c9f17 100644 (file)
@@ -24,8 +24,7 @@
 #include <time.h>
 
 int debugsw = 0;  /* global */
-int verbosesw = 0;
-char *altmsg   = NULL;
+char *altmsg = NULL;
 char *annotext = NULL;
 char *distfile = NULL;
 
@@ -118,9 +117,7 @@ main(int argc, char **argv)
                                debugsw++;
                                /* fall */
                        case VERBSW:
-                               verbosesw += 2;
                        case NVERBSW:
-                               verbosesw--;
                                vec[vecp++] = --cp;
                                continue;
                        }
@@ -653,12 +650,9 @@ sendaux(char **vec, int vecp, char *drft, struct stat *st)
                        if (annotext) {
                                anno(st);
                        }
-               }
-               else {
+               } else {
+                       /* spost failed */
                        advise(NULL, "%s", strexit(status));
-                       if (verbosesw <= 0) {
-                               advise(NULL, "Try using -v to get better output");
-                       }
                        if (distfile) {
                                unlink(drft);
                                if (rename(backup, drft) == NOTOK) {
@@ -722,13 +716,13 @@ strexit(int status)
                return "spost or sendmail killed by signal";
        }
        if (!WIFEXITED(status)) {
-               return "sendmail stopt for unknown reasen, message not deliverd to anyone";
+               return "message not delivered to anyone";
        }
        switch (WEXITSTATUS(status)) {
-               case EX_TEMPFAIL:
-                       return "Temporary error, maby the MTA hase queued the Mail";
-               default:
-                       return "sendmail stopt for unknown reasen, message not deliverd to anyone";
+       case EX_TEMPFAIL:
+               return "Temporary error, maybe the MTA has queued the message";
+       default:
+               return "message not delivered to anyone";
        }
 }