]> andersk Git - moira.git/commitdiff
Add -n flag to suppress use of FixCase(), since it's heuristics aren't
authorzacheiss <zacheiss>
Fri, 6 May 2005 18:11:59 +0000 (18:11 +0000)
committerzacheiss <zacheiss>
Fri, 6 May 2005 18:11:59 +0000 (18:11 +0000)
always correct.

clients/addusr/addusr.c

index 31dd22944495713b4f2de60f649d61ba5aef7d65..1f66dbd2691d7749f53d46d59ea5313e2f6b1359 100644 (file)
@@ -31,7 +31,7 @@ RCSID("$Header$");
 
 /* flags from command line */
 char *class, *comment, *status_str, *shell, *winconsoleshell, *filename;
-int reg_only, reg, verbose, nodupcheck, securereg;
+int reg_only, reg, verbose, nodupcheck, securereg, nocaps;
 
 /* argument parsing macro */
 #define argis(a, b) (!strcmp(*arg + 1, a) || !strcmp(*arg + 1, b))
@@ -52,7 +52,7 @@ int main(int argc, char **argv)
   FILE *input;
 
   /* clear all flags & lists */
-  reg_only = reg = verbose = lineno = nodupcheck = errors = securereg = 0;
+  reg_only = reg = verbose = lineno = nodupcheck = errors = securereg = nocaps = 0;
   server = NULL;
   filename = "-";
   shell = DEFAULT_SHELL;
@@ -138,6 +138,8 @@ int main(int argc, char **argv)
            verbose++;
          else if (argis("d", "nodupcheck"))
            nodupcheck++;
+         else if (argis("n", "nocaps"))
+           nocaps++;
          else if (argis("S", "server") || argis("db", "database"))
            {
              if (arg - argv < argc - 1)
@@ -249,9 +251,12 @@ int main(int argc, char **argv)
       qargv[U_MIDDLE] = strtrim(middle);
       qargv[U_LAST] = strtrim(last);
       qargv[U_MITID] = strtrim(id);
-      FixCase(qargv[U_FIRST]);
-      FixCase(qargv[U_MIDDLE]);
-      FixCase(qargv[U_LAST]);
+      if (!nocaps)
+       {
+         FixCase(qargv[U_FIRST]);
+         FixCase(qargv[U_MIDDLE]);
+         FixCase(qargv[U_LAST]);
+       }
       RemoveHyphens(qargv[U_MITID]);
       if (!reg_only)
        {
@@ -358,6 +363,7 @@ void usage(char **argv)
   fprintf(stderr, "   -R | -register (and add to database)\n");
   fprintf(stderr, "   -v | -verbose\n");
   fprintf(stderr, "   -d | -nodupcheck (don't check for duplicates)\n");
+  fprintf(stderr, "   -n | -nocaps (don't fix capitalization of names)\n");
   fprintf(stderr, "   -db | -database host:port\n");
   exit(1);
 }
This page took 0.041676 seconds and 5 git commands to generate.