Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: net/tools/quic/quic_client_bin.cc

Issue 25043005: Add better help information to quic_client and quic_server. Also, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_client_bin.cc
diff --git a/net/tools/quic/quic_client_bin.cc b/net/tools/quic/quic_client_bin.cc
index e13bea5e8c12abb58dcc5facd242ac13cea979d8..5591b8798b76fe744bfef7c791e0b1cce5f490cf 100644
--- a/net/tools/quic/quic_client_bin.cc
+++ b/net/tools/quic/quic_client_bin.cc
@@ -2,11 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// A binary wrapper for QuicClient. Connects to --hostname or --address on
-// --port and requests URLs specified on the command line.
+// A binary wrapper for QuicClient. Connects to --hostname via --address
+// on --port and requests URLs specified on the command line.
//
// For example:
-// quic_client --port=6122 /index.html /favicon.ico
+// quic_client --address=127.0.0.1 --port=6122 --hostname=www.google.com
+// http://www.google.com/index.html http://www.google.com/favicon.ico
+
+#include <iostream>
#include "base/at_exit.h"
#include "base/command_line.h"
@@ -23,6 +26,18 @@ std::string FLAGS_hostname = "localhost";
int main(int argc, char *argv[]) {
CommandLine::Init(argc, argv);
CommandLine* line = CommandLine::ForCurrentProcess();
+ if (line->HasSwitch("h") || line->HasSwitch("help")) {
+ const char* help_str =
+ "Usage: quic_client [options]\n"
+ "\n"
+ "Options:\n"
+ "-h, --help show this help message and exit\n"
+ "--port=<port> specify the port to connect to\n"
+ "--address=<address> specify the IP address to connect to\n"
+ "--host=<host> specify the SNI hostname to use\n";
+ std::cout << help_str;
+ exit(0);
+ }
if (line->HasSwitch("port")) {
int port;
if (base::StringToInt(line->GetSwitchValueASCII("port"), &port)) {
@@ -44,8 +59,8 @@ int main(int argc, char *argv[]) {
net::IPAddressNumber addr;
CHECK(net::ParseIPLiteralToNumber(FLAGS_address, &addr));
// TODO(rjshade): Set version on command line.
- net::tools::QuicClient client(
- net::IPEndPoint(addr, FLAGS_port), FLAGS_hostname, net::QuicVersionMax());
+ net::tools::QuicClient client(net::IPEndPoint(addr, FLAGS_port),
+ FLAGS_hostname, net::QuicVersionMax(), true);
client.Initialize();
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698