minijail0: support --help too
Make sure we exit(0) when the user has requested help explicitly.
Change-Id: Ia76d6897a9022afb6c7820479bf5268e959dea35
diff --git a/minijail0.c b/minijail0.c
index df59690..c41128d 100644
--- a/minijail0.c
+++ b/minijail0.c
@@ -351,6 +351,7 @@
int longoption_index = 0;
/* clang-format off */
const struct option long_options[] = {
+ {"help", no_argument, 0, 'h'},
{"mount-dev", no_argument, 0, 'd'},
{"ambient", no_argument, 0, 128},
{"uts", optional_argument, 0, 129},
@@ -595,7 +596,7 @@
break;
default:
usage(argv[0]);
- exit(1);
+ exit(opt == 'h' ? 0 : 1);
}
}