Renamed switches variable to ease automatic text extraction.
authormarkus schnalke <meillo@marmaro.de>
Wed, 13 Jun 2012 10:02:06 +0000 (12:02 +0200)
committermarkus schnalke <meillo@marmaro.de>
Wed, 13 Jun 2012 10:02:06 +0000 (12:02 +0200)
Now, it's easier to get a list of all switches of a program from the
source code. The change improves the homogeneity, too.

uip/mhl.c
uip/spost.c
uip/whatnow.c

index 18d0176..5280ade 100644 (file)
--- a/uip/mhl.c
+++ b/uip/mhl.c
@@ -40,7 +40,7 @@
 
 #define QUOTE  '\\'
 
-static struct swit mhlswitches[] = {
+static struct swit switches[] = {
 #define FORMSW  0
        { "form formfile", 0 },
 #define WIDTHSW  1
@@ -240,16 +240,16 @@ main(int argc, char **argv)
 
        while ((cp = *argp++)) {
                if (*cp == '-') {
-                       switch (smatch(++cp, mhlswitches)) {
+                       switch (smatch(++cp, switches)) {
                        case AMBIGSW:
-                               ambigsw(cp, mhlswitches);
+                               ambigsw(cp, switches);
                                done(1);
                        case UNKWNSW:
                                adios(NULL, "-%s unknown\n", cp);
 
                        case HELPSW:
                                snprintf(buf, sizeof(buf), "%s [switches] [files ...]", invo_name);
-                               print_help(buf, mhlswitches, 1);
+                               print_help(buf, switches, 1);
                                done(1);
                        case VERSIONSW:
                                print_version(invo_name);
index 4c1210b..73f9b0a 100644 (file)
@@ -19,7 +19,7 @@
 
 #define MAX_SM_FIELD 1476  /* < largest hdr field sendmail will accept */
 
-struct swit switches[] = {
+static struct swit switches[] = {
 #define VERBSW  0
        { "verbose", 0 },
 #define NVERBSW  1
index 273921c..118afe8 100644 (file)
@@ -41,7 +41,7 @@
 #include <h/mime.h>
 #include <h/utils.h>
 
-static struct swit whatnowswitches[] = {
+static struct swit switches[] = {
 #define EDITRSW  0
        { "editor editor", 0 },
 #define PRMPTSW  1
@@ -134,9 +134,9 @@ main(int argc, char **argv)
 
        while ((cp = *argp++)) {
                if (*cp == '-') {
-                       switch (smatch(++cp, whatnowswitches)) {
+                       switch (smatch(++cp, switches)) {
                        case AMBIGSW:
-                               ambigsw(cp, whatnowswitches);
+                               ambigsw(cp, switches);
                                done(1);
                        case UNKWNSW:
                                adios(NULL, "-%s unknown", cp);
@@ -145,7 +145,7 @@ main(int argc, char **argv)
                                snprintf(buf, sizeof(buf),
                                                "%s [switches] [file]",
                                                invo_name);
-                               print_help(buf, whatnowswitches, 1);
+                               print_help(buf, switches, 1);
                                done(1);
                        case VERSIONSW:
                                print_version(invo_name);