Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
f5342494
Commit
f5342494
authored
Feb 16, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Format help message and add --version to make man page generation easier
parent
1fd5fdd5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
375 additions
and
348 deletions
+375
-348
src/nghttp.cc
src/nghttp.cc
+66
-54
src/nghttpd.cc
src/nghttpd.cc
+54
-35
src/shrpx.cc
src/shrpx.cc
+255
-259
No files found.
src/nghttp.cc
View file @
f5342494
...
...
@@ -1654,14 +1654,18 @@ int run(char **uris, int n)
}
}
// namespace
namespace
{
void
print_version
(
std
::
ostream
&
out
)
{
out
<<
"nghttp nghttp2/"
NGHTTP2_VERSION
<<
std
::
endl
;
}
}
// namespace
namespace
{
void
print_usage
(
std
::
ostream
&
out
)
{
out
<<
"Usage: nghttp [-Oansuv] [-t <SECONDS>] [-w <WINDOW_BITS>] [-W <WINDOW_BITS>]
\n
"
<<
" [--cert=<CERT>] [--key=<KEY>] [-d <FILE>] [-m <N>]
\n
"
<<
" [-p <PRIORITY>] [-M <N>] [-b <ALIGNMENT>]
\n
"
<<
" <URI>..."
<<
std
::
endl
;
out
<<
"Usage: nghttp [OPTIONS]... <URI>...
\n
"
<<
"HTTP/2 experimental client"
<<
std
::
endl
;
}
}
// namespace
...
...
@@ -1670,7 +1674,8 @@ void print_help(std::ostream& out)
{
print_usage
(
out
);
out
<<
"
\n
"
<<
"OPTIONS:
\n
"
<<
" <URI> Specify URI to access.
\n
"
<<
"Options:
\n
"
<<
" -v, --verbose Print debug information such as reception/
\n
"
<<
" transmission of frames and name/value pairs.
\n
"
<<
" -n, --null-out Discard downloaded data.
\n
"
...
...
@@ -1720,6 +1725,8 @@ void print_help(std::ostream& out)
<<
" padding. Specify 0 to disable padding.
\n
"
<<
" --color Force colored log output.
\n
"
<<
" --continuation Send large header to test CONTINUATION.
\n
"
<<
" --version Display version information and exit.
\n
"
<<
" -h, --help Display this help and exit.
\n
"
<<
std
::
endl
;
}
}
// namespace
...
...
@@ -1751,6 +1758,7 @@ int main(int argc, char **argv)
{
"key"
,
required_argument
,
&
flag
,
2
},
{
"color"
,
no_argument
,
&
flag
,
3
},
{
"continuation"
,
no_argument
,
&
flag
,
4
},
{
"version"
,
no_argument
,
&
flag
,
5
},
{
nullptr
,
0
,
nullptr
,
0
}
};
int
option_index
=
0
;
...
...
@@ -1889,6 +1897,10 @@ int main(int argc, char **argv)
// continuation option
config
.
continuation
=
true
;
break
;
case
5
:
// version option
print_version
(
std
::
cout
);
exit
(
EXIT_SUCCESS
);
}
break
;
default:
...
...
src/nghttpd.cc
View file @
f5342494
...
...
@@ -72,12 +72,19 @@ int parse_push_config(Config& config, const char *optarg)
}
}
// namespace
namespace
{
void
print_version
(
std
::
ostream
&
out
)
{
out
<<
"nghttpd nghttp2/"
NGHTTP2_VERSION
<<
std
::
endl
;
}
}
// namespace
namespace
{
void
print_usage
(
std
::
ostream
&
out
)
{
out
<<
"Usage: nghttpd [
-DVhpv] [-d <PATH>] [--no-tls] [-b <ALIGNMENT>]
\n
"
<<
"
<PORT> [<PRIVATE_KEY> <CERT>]
"
<<
std
::
endl
;
out
<<
"Usage: nghttpd [
OPTION]... <PORT> <PRIVATE_KEY> <CERT>
\n
"
<<
"
or: nghttpd --no-tls [OPTION]... <PORT>
\n
"
<<
"HTTP/2 experimental server"
<<
std
::
endl
;
}
}
// namespace
...
...
@@ -86,7 +93,13 @@ void print_help(std::ostream& out)
{
print_usage
(
out
);
out
<<
"
\n
"
<<
"OPTIONS:
\n
"
<<
" <PORT> Specify listening port number.
\n
"
<<
" <PRIVATE_KEY> Set path to server's private key. Required
\n
"
<<
" unless --no-tls is specified.
\n
"
<<
" <CERT> Set path to server's certificate. Required
\n
"
<<
" unless --no-tls is specified.
\n
"
<<
"
\n
"
<<
"Options:
\n
"
<<
" -D, --daemon Run in a background. If -D is used, the
\n
"
<<
" current working directory is changed to '/'.
\n
"
<<
" Therefore if this option is used, -d option
\n
"
...
...
@@ -117,7 +130,8 @@ void print_help(std::ostream& out)
<<
" root. See --htdocs option.
\n
"
<<
" -b, --padding=<N> Add at most <N> bytes to a frame payload as
\n
"
<<
" padding. Specify 0 to disable padding.
\n
"
<<
" -h, --help Print this help.
\n
"
<<
" --version Display version information and exit.
\n
"
<<
" -h, --help Display this help and exit.
\n
"
<<
std
::
endl
;
}
}
// namespace
...
...
@@ -139,6 +153,7 @@ int main(int argc, char **argv)
{
"padding"
,
required_argument
,
nullptr
,
'b'
},
{
"no-tls"
,
no_argument
,
&
flag
,
1
},
{
"color"
,
no_argument
,
&
flag
,
2
},
{
"version"
,
no_argument
,
&
flag
,
3
},
{
nullptr
,
0
,
nullptr
,
0
}
};
int
option_index
=
0
;
...
...
@@ -192,6 +207,10 @@ int main(int argc, char **argv)
// color option
color
=
true
;
break
;
case
3
:
// version
print_version
(
std
::
cout
);
exit
(
EXIT_SUCCESS
);
}
break
;
default:
...
...
src/shrpx.cc
View file @
f5342494
...
...
@@ -462,12 +462,8 @@ void print_version(std::ostream& out)
namespace
{
void
print_usage
(
std
::
ostream
&
out
)
{
out
<<
"Usage: nghttpx [-Dh] [-s|--client|-p] [-b <HOST,PORT>]
\n
"
<<
" [-f <HOST,PORT>] [-n <CORES>] [-c <NUM>] [-L <LEVEL>]
\n
"
<<
" [OPTIONS...] [<PRIVATE_KEY> <CERT>]
\n
"
<<
"
\n
"
<<
"A reverse proxy for HTTP/2, HTTP/1 and SPDY.
\n
"
<<
std
::
endl
;
out
<<
"Usage: nghttpx [OPTIONS]... [<PRIVATE_KEY> <CERT>]
\n
"
<<
"A reverse proxy for HTTP/2, HTTP/1 and SPDY."
<<
std
::
endl
;
}
}
// namespace
...
...
@@ -475,17 +471,17 @@ namespace {
void
print_help
(
std
::
ostream
&
out
)
{
print_usage
(
out
);
out
<<
"
Positional arguments:
\n
"
out
<<
"
\n
"
<<
" <PRIVATE_KEY> Set path to server's private key. Required
\n
"
<<
" unless -p, --client or --frontend-no-tls
\n
"
<<
" are given.
\n
"
<<
" <CERT> Set path to server's certificate. Required
\n
"
<<
" unless -p, --client or --frontend-no-tls
\n
"
<<
" are given.
\n
"
<<
"Options:
\n
"
<<
" The options are categorized into several groups.
\n
"
<<
"
\n
"
<<
"OPTIONS:
\n
"
<<
"
\n
"
<<
" Connections:
\n
"
<<
"Connections:
\n
"
<<
" -b, --backend=<HOST,PORT>
\n
"
<<
" Set backend host and port.
\n
"
<<
" Default: '"
...
...
@@ -504,7 +500,7 @@ void print_help(std::ostream& out)
<<
" --backend-ipv6 Resolve backend hostname to IPv6 address
\n
"
<<
" only.
\n
"
<<
"
\n
"
<<
"
Performance:
\n
"
<<
"Performance:
\n
"
<<
" -n, --workers=<CORES>
\n
"
<<
" Set the number of worker threads.
\n
"
<<
" Default: "
...
...
@@ -533,7 +529,7 @@ void print_help(std::ostream& out)
<<
" Default: "
<<
get_config
()
->
write_burst
<<
"
\n
"
<<
"
\n
"
<<
"
Timeout:
\n
"
<<
"Timeout:
\n
"
<<
" --frontend-http2-read-timeout=<SEC>
\n
"
<<
" Specify read timeout for HTTP/2.0 and SPDY frontend
\n
"
<<
" connection. Default: "
...
...
@@ -574,7 +570,7 @@ void print_help(std::ostream& out)
<<
" can be specified by --backend-read-timeout
\n
"
<<
" and --backend-write-timeout options.
\n
"
<<
"
\n
"
<<
"
SSL/TLS:
\n
"
<<
"SSL/TLS:
\n
"
<<
" --ciphers=<SUITE> Set allowed cipher list. The format of the
\n
"
<<
" string is described in OpenSSL ciphers(1).
\n
"
<<
" If this option is used, --honor-cipher-order
\n
"
...
...
@@ -644,7 +640,7 @@ void print_help(std::ostream& out)
<<
" as a part of protocol string.
\n
"
<<
" Default: "
<<
DEFAULT_TLS_PROTO_LIST
<<
"
\n
"
<<
"
\n
"
<<
"
HTTP/2.0 and SPDY:
\n
"
<<
"HTTP/2.0 and SPDY:
\n
"
<<
" -c, --http2-max-concurrent-streams=<NUM>
\n
"
<<
" Set the maximum number of the concurrent
\n
"
<<
" streams in one HTTP/2.0 and SPDY session.
\n
"
...
...
@@ -682,7 +678,7 @@ void print_help(std::ostream& out)
<<
" meant for debugging purpose and not intended
\n
"
<<
" to enhance protocol security.
\n
"
<<
"
\n
"
<<
"
Mode:
\n
"
<<
"Mode:
\n
"
<<
" (default mode) Accept HTTP/2.0, SPDY and HTTP/1.1 over
\n
"
<<
" SSL/TLS. If --frontend-no-tls is used,
\n
"
<<
" accept HTTP/2.0 and HTTP/1.1. The incoming
\n
"
...
...
@@ -709,7 +705,7 @@ void print_help(std::ostream& out)
<<
" an absolute URI, suitable for use as a
\n
"
<<
" forward proxy.
\n
"
<<
"
\n
"
<<
"
Logging:
\n
"
<<
"Logging:
\n
"
<<
" -L, --log-level=<LEVEL>
\n
"
<<
" Set the severity level of log output.
\n
"
<<
" INFO, WARNING, ERROR and FATAL.
\n
"
...
...
@@ -721,7 +717,7 @@ void print_help(std::ostream& out)
<<
" Default: "
<<
str_syslog_facility
(
get_config
()
->
syslog_facility
)
<<
"
\n
"
<<
"
\n
"
<<
"
Misc:
\n
"
<<
"Misc:
\n
"
<<
" --add-x-forwarded-for
\n
"
<<
" Append X-Forwarded-For header field to the
\n
"
<<
" downstream request.
\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment