Skip to content
Snippets Groups Projects
Commit 8af4c169 authored by René Kijewski's avatar René Kijewski
Browse files

Merge pull request #1035 from LudwigOrtmann/issue_840

native: add help option
parents 066d743c 6044dc28
No related branches found
No related tags found
No related merge requests found
......@@ -162,7 +162,10 @@ void usage_exit()
real_printf(" [-d] [-e|-E] [-o]\n");
real_printf(" help: %s -h\n", _progname);
real_printf("\nOptions:\n\
-h help\n\
-d daemonize\n\
-e redirect stderr to file\n\
-E do not redirect stderr (i.e. leave sterr unchanged despite socket/daemon io)\n\
......@@ -203,7 +206,13 @@ __attribute__((constructor)) static void startup(int argc, char **argv)
#endif
#ifdef MODULE_NATIVENET
if (argc < 2) {
if (
(argc < 2)
|| (
(strcmp("-h", argv[argp]) == 0)
|| (strcmp("--help", argv[argp]) == 0)
)
) {
usage_exit();
}
argp++;
......@@ -211,7 +220,10 @@ __attribute__((constructor)) static void startup(int argc, char **argv)
for (; argp < argc; argp++) {
char *arg = argv[argp];
if (strcmp("-d", arg) == 0) {
if ((strcmp("-h", arg) == 0) || (strcmp("--help", arg) == 0)) {
usage_exit();
}
else if (strcmp("-d", arg) == 0) {
daemonize();
if (strcmp(stdiotype, "stdio") == 0) {
stdiotype = "null";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment