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

Unified Diff: cloud_print/gcp20/prototype/gcp20_switches.cc

Issue 587103002: GCP 2.0 prototype switches code cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sun Sep 21 21:20:21 PDT 2014 Created 6 years, 3 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 | « cloud_print/gcp20/prototype/gcp20_switches.h ('k') | cloud_print/gcp20/prototype/print_job_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/gcp20/prototype/gcp20_switches.cc
diff --git a/cloud_print/gcp20/prototype/gcp20_switches.cc b/cloud_print/gcp20/prototype/gcp20_switches.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cce7eaf0d842e8fedf3b5bbd5cc13e8dfba82e92
--- /dev/null
+++ b/cloud_print/gcp20/prototype/gcp20_switches.cc
@@ -0,0 +1,63 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cloud_print/gcp20/prototype/gcp20_switches.h"
+
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+
+namespace switches {
+
+const char kDisableConfirmation[] = "disable-confirmation";
+const char kDisableMethodCheck[] = "disable-method-check";
+const char kDisableXTocken[] = "disable-x-token";
+const char kDomainName[] = "domain-name";
+const char kExtendedResponce[] = "extended-response";
+const char kHelpShort[] = "h";
+const char kHelp[] = "help";
+const char kHttpPort[] = "http-port";
+const char kNoAnnouncement[] = "no-announcement";
+const char kServiceName[] = "service-name";
+const char kSimulatePrintingErrors[] = "simulate-printing-errors";
+const char kStatePath[] = "state-path";
+const char kTtl[] = "ttl";
+const char kUnicastRespond[] = "unicast-respond";
+
+const struct {
+ const char* const name;
+ const char* const description;
+ const char* const arg;
+} kHelpStrings[] = {
+ {kDisableConfirmation, "disables confirmation of registration", NULL},
+ {kDisableMethodCheck, "disables HTTP method checking (POST, GET)", NULL},
+ {kDisableXTocken, "disables checking of X-Privet-Token HTTP header", NULL},
+ {kNoAnnouncement, "disables DNS announcements", NULL},
+ {kExtendedResponce, "responds to PTR with additional records", NULL},
+ {kSimulatePrintingErrors, "simulates some errors for local printing", NULL},
+ {kUnicastRespond,
+ "DNS responses will be sent in unicast instead of multicast", NULL},
+ {kDomainName, "sets, should ends with '.local'", "DOMAIN"},
+ {kHttpPort, "sets port for HTTP server", "PORT"},
+ {kServiceName, "sets DNS service name", "SERVICE"},
+ {kStatePath, "sets path to file with registration state", "PATH"},
+ {kTtl, "sets TTL for DNS announcements", "TTL"},
+};
+
+void PrintUsage() {
+ base::FilePath exe;
+ PathService::Get(base::FILE_EXE, &exe);
+ printf("usage: %s [OPTION]...\n\n", exe.BaseName().MaybeAsASCII().c_str());
+ for (size_t i = 0; i < arraysize(kHelpStrings); ++i) {
+ std::string name = kHelpStrings[i].name;
+ if (kHelpStrings[i].arg) {
+ name += '=';
+ name += kHelpStrings[i].arg;
+ }
+ name.resize(27, ' ');
+ printf(" --%s%s\n", name.c_str(), kHelpStrings[i].description);
+ }
+ printf("\n WARNING: mDNS probing is not implemented\n");
+}
+
+} // namespace switches
« no previous file with comments | « cloud_print/gcp20/prototype/gcp20_switches.h ('k') | cloud_print/gcp20/prototype/print_job_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698