swtpm_localca: Exit with error code 1 on unknown option

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2021-10-08 09:40:55 -04:00 committed by Stefan Berger
parent f1d425b5c1
commit 79e4c44c04

View 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);