From e2ff41c44c7e39fe14df4e0ebcd48223201f845b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 16 Sep 2013 16:44:13 +0900 Subject: [PATCH] nghttp: Use -M as short option for --peer-max-concurrent-streams --- src/nghttp.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/nghttp.cc b/src/nghttp.cc index 52e54d53..b91d1e5d 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -1433,7 +1433,7 @@ int run(char **uris, int n) void print_usage(std::ostream& out) { out << "Usage: nghttp [-Oafnsuv] [-t ] [-w ] [--cert=]\n" - << " [--key=] [-d ] [-m ] [-p ]\n" + << " [--key=] [-d ] [-m ] [-p ] [-M ]\n" << " ..." << std::endl; } @@ -1480,7 +1480,7 @@ void print_help(std::ostream& out) << " -p, --pri=\n" << " Sets stream priority. Default: " << NGHTTP2_PRI_DEFAULT << "\n" - << " --peer-max-concurrent-streams=\n" + << " -M, --peer-max-concurrent-streams=\n" << " Use as SETTINGS_MAX_CONCURRENT_STREAMS\n" << " value of remote endpoint as if it is\n" << " received in SETTINGS frame. The default\n" @@ -1509,16 +1509,20 @@ int main(int argc, char **argv) {"no-flow-control", no_argument, nullptr, 'f'}, {"upgrade", no_argument, nullptr, 'u'}, {"pri", required_argument, nullptr, 'p'}, - {"peer-max-concurrent-streams", required_argument, &flag, 3}, + {"peer-max-concurrent-streams", required_argument, nullptr, 'M'}, {nullptr, 0, nullptr, 0 } }; int option_index = 0; - int c = getopt_long(argc, argv, "Oad:fm:np:hH:vst:uw:", long_options, + int c = getopt_long(argc, argv, "M:Oad:fm:np:hH:vst:uw:", long_options, &option_index); if(c == -1) { break; } switch(c) { + case 'M': + // peer-max-concurrent-streams option + config.peer_max_concurrent_streams = strtoul(optarg, nullptr, 10); + break; case 'O': config.remote_name = true; break; @@ -1617,10 +1621,6 @@ int main(int argc, char **argv) // key option config.keyfile = optarg; break; - case 3: - // peer-max-concurrent-streams option - config.peer_max_concurrent_streams = strtoul(optarg, nullptr, 10); - break; } break; default: