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

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

Issue 466513002: Check that user has supplied at least one URL argument to quic_client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename args to urls Created 6 years, 4 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 | « no previous file | no next file » | 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 f743a7dc127213e78a79078b2fb0db7e4395c126..b9ea9153a202a81a3b7e546b1f798d061e7a2ba2 100644
--- a/net/tools/quic/quic_client_bin.cc
+++ b/net/tools/quic/quic_client_bin.cc
@@ -44,15 +44,18 @@ bool FLAGS_secure = false;
int main(int argc, char *argv[]) {
base::CommandLine::Init(argc, argv);
base::CommandLine* line = base::CommandLine::ForCurrentProcess();
+ const base::CommandLine::StringVector& urls = line->GetArgs();
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
CHECK(logging::InitLogging(settings));
- if (line->HasSwitch("h") || line->HasSwitch("help")) {
+ if (line->HasSwitch("h") || line->HasSwitch("help") || urls.empty()) {
const char* help_str =
- "Usage: quic_client [options]\n"
+ "Usage: quic_client [options] <url> ...\n"
"\n"
+ "At least one <url> with scheme must be provided "
+ "(e.g. http://www.google.com/)\n\n"
"Options:\n"
"-h, --help show this help message and exit\n"
"--port=<port> specify the port to connect to\n"
@@ -108,6 +111,6 @@ int main(int argc, char *argv[]) {
if (!client.Connect()) return 1;
- client.SendRequestsAndWaitForResponse(line->GetArgs());
+ client.SendRequestsAndWaitForResponse(urls);
return 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698