samples: fix inconsistency in parse_opts vs usage

PR-URL: https://github.com/libuv/libuv/pull/1883
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
zyxwvu Shi 2018-06-15 23:56:27 +08:00 committed by Ben Noordhuis
parent e179bd1b43
commit 52cce6a4c0

View File

@ -63,9 +63,9 @@ const char *_getprogname(void) {
static void parse_opts(server_config *cf, int argc, char **argv) { static void parse_opts(server_config *cf, int argc, char **argv) {
int opt; int opt;
while (-1 != (opt = getopt(argc, argv, "H:hp:"))) { while (-1 != (opt = getopt(argc, argv, "b:hp:"))) {
switch (opt) { switch (opt) {
case 'H': case 'b':
cf->bind_host = optarg; cf->bind_host = optarg;
break; break;
@ -85,7 +85,7 @@ static void parse_opts(server_config *cf, int argc, char **argv) {
static void usage(void) { static void usage(void) {
printf("Usage:\n" printf("Usage:\n"
"\n" "\n"
" %s [-b <address> [-h] [-p <port>]\n" " %s [-b <address>] [-h] [-p <port>]\n"
"\n" "\n"
"Options:\n" "Options:\n"
"\n" "\n"