]> git.proxmox.com Git - swtpm.git/commitdiff
swtpm_localca: Exit with error code 1 on unknown option
authorStefan Berger <stefanb@linux.ibm.com>
Fri, 8 Oct 2021 13:40:55 +0000 (09:40 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Fri, 8 Oct 2021 15:20:59 +0000 (11:20 -0400)
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
src/swtpm_localca/swtpm_localca.c

index f35b117b74db5d6b7c491fc31e08e55c084cff9d..7879702d5cf1610f78d04a0682641ebfd4c0de03 100644 (file)
@@ -555,7 +555,7 @@ static void usage(const char *prgname)
         "--tpm2                Generate a certificate for a TPM 2\n"
         "--allow-signing       The TPM 2's EK can be used for signing\n"
         "--decryption          The TPM 2's EK can be used for decryption\n"
-        "--help, -h, -?        Display this help screen and exit\n"
+        "--help, -h            Display this help screen and exit\n"
         "\n"
         "\n"
         "The following environment variables are supported:\n"
@@ -674,7 +674,8 @@ int main(int argc, char *argv[])
         case '?':
         case 'h': /* --help */
             usage(argv[0]);
-            ret = 0;
+            if (opt == 'h')
+                ret = 0;
             goto out;
         default:
             fprintf(stderr, "Unknown option code %d\n", opt);