Exit successfully on -help
authorAndrew Deason <adeason@sinenomine.net>
Wed, 30 Oct 2013 02:11:54 +0000 (21:11 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 5 Nov 2013 02:36:18 +0000 (18:36 -0800)
Running a command with -help is not an error. cmd_Dispatch handles
this correctly, but several server processes call cmd_Parse directly,
and exit with failure on -help. Make them exit successfully instead.

Change-Id: Ieab32ba4a62a182308538469e69320d241dc3aad
Reviewed-on: http://gerrit.openafs.org/10421
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/ptserver/ptserver.c
src/viced/viced.c
src/vlserver/vlserver.c
src/volser/volmain.c

index d7b6516..8df4e3a 100644 (file)
@@ -351,6 +351,9 @@ main(int argc, char **argv)
                        "permit Kerberos 5 principals with dots");
 
     code = cmd_Parse(argc, argv, &opts);
+    if (code == CMD_HELP) {
+       PT_EXIT(0);
+    }
     if (code)
        PT_EXIT(1);
 
index 2ed8324..e47bcbc 100644 (file)
@@ -1165,6 +1165,9 @@ ParseArgs(int argc, char *argv[])
            CMD_OPTIONAL, "configuration location");
 
     code = cmd_Parse(argc, argv, &opts);
+    if (code == CMD_HELP) {
+       exit(0);
+    }
     if (code)
        return -1;
 
index 2569e7a..02aeecc 100644 (file)
@@ -264,6 +264,9 @@ main(int argc, char **argv)
                        "permit Kerberos 5 principals with dots");
 
     code = cmd_Parse(argc, argv, &opts);
+    if (code == CMD_HELP) {
+       exit(0);
+    }
     if (code)
        return -1;
 
index 0a42b36..367a8a8 100644 (file)
@@ -330,7 +330,9 @@ ParseArgs(int argc, char **argv) {
           CMD_OPTIONAL, "configuration location");
 
     code = cmd_Parse(argc, argv, &opts);
-
+    if (code == CMD_HELP) {
+       exit(0);
+    }
     if (code)
        return 1;