summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-04-13 20:07:02 +0300
committerValentin Bartenev <vbart@nginx.com>2018-04-13 20:07:02 +0300
commit555141f7989ede1bd3fc491daf2c9de3e946a189 (patch)
tree84e6ba90b5d2bb83843b43d39aef631e30e0d55b
parent115949c50fda7590bebef8a2c15e34ff3f9f9707 (diff)
downloadunit-555141f7989ede1bd3fc491daf2c9de3e946a189.tar.gz
unit-555141f7989ede1bd3fc491daf2c9de3e946a189.tar.bz2
Improved "unitd" command line help.
Diffstat (limited to '')
-rw-r--r--src/nxt_runtime.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index e48f8b58..b581209d 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -990,7 +990,7 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
exit(0);
}
- if (nxt_strcmp(p, "--help") == 0) {
+ if (nxt_strcmp(p, "--help") == 0 || nxt_strcmp(p, "-h") == 0) {
write(STDOUT_FILENO, help, sizeof(help) - 1);
if (sizeof(NXT_GROUP) == 1) {
@@ -1003,7 +1003,10 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
exit(0);
}
- end = nxt_sprintf(buf, buf + sizeof(buf), "unknown option \"%s\"\n", p);
+ end = nxt_sprintf(buf, buf + sizeof(buf), "unknown option \"%s\", "
+ "try \"%s -h\" for available options\n",
+ p, nxt_process_argv[0]);
+
write(STDERR_FILENO, buf, end - buf);
return NXT_ERROR;