Commit abbfd37e authored by rjshade's avatar rjshade Committed by Commit bot

Check that user has supplied at least one URL argument to quic_client

BUG=

Review URL: https://codereview.chromium.org/466513002

Cr-Commit-Position: refs/heads/master@{#292642}
parent 05f44340
......@@ -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;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment