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

Unified Diff: cloud_print/gcp20/prototype/gcp20_device.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/dns_sd_server.cc ('k') | cloud_print/gcp20/prototype/gcp20_device.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/gcp20/prototype/gcp20_device.cc
diff --git a/cloud_print/gcp20/prototype/gcp20_device.cc b/cloud_print/gcp20/prototype/gcp20_device.cc
index 2b38a9af4eb35b4574fc77f41ecc1ad38d3cf86e..9bb71b10d20f2c00ec5d21f6ec1a5943ce0e41d6 100644
--- a/cloud_print/gcp20/prototype/gcp20_device.cc
+++ b/cloud_print/gcp20/prototype/gcp20_device.cc
@@ -12,38 +12,11 @@
#include "base/run_loop.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
+#include "cloud_print/gcp20/prototype/gcp20_switches.h"
#include "cloud_print/gcp20/prototype/printer.h"
namespace {
-const char kHelpMessage[] =
- "usage: gcp20_device [switches] [options]\n"
- "\n"
- "switches:\n"
- " --disable-confirmation disables confirmation of registration\n"
- " --disable-method-check disables HTTP method checking (POST, GET)\n"
- " --disable-x-token disables checking of X-Privet-Token "
- "HTTP header\n"
- " -h, --help prints this message\n"
- " --no-announcement disables DNS announcements\n"
- " --extended-response responds to PTR with additional records\n"
- " --simulate-printing-errors simulates some errors for local printing\n"
- " --unicast-respond DNS responses will be sent in unicast "
- "instead of multicast\n"
- "\n"
- "options:\n"
- " --domain-name=<name> sets, should ends with '.local'\n"
- " --http-port=<value> sets port for HTTP server\n"
- " --service-name=<name> sets DNS service name\n"
- " --state-path=<path> sets path to file with registration state\n"
- " --ttl=<value> sets TTL for DNS announcements\n"
- "\n"
- "WARNING: mDNS probing is not implemented\n";
-
-void PrintHelp() {
- printf("%s", kHelpMessage);
-}
-
void StartPrinter(Printer* printer) {
bool success = printer->Start();
DCHECK(success);
@@ -83,9 +56,9 @@ int main(int argc, char* argv[]) {
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
logging::InitLogging(settings);
- if (CommandLine::ForCurrentProcess()->HasSwitch("h") ||
- CommandLine::ForCurrentProcess()->HasSwitch("help")) {
- PrintHelp();
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kHelp) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kHelpShort)) {
+ switches::PrintUsage();
return 0;
}
« no previous file with comments | « cloud_print/gcp20/prototype/dns_sd_server.cc ('k') | cloud_print/gcp20/prototype/gcp20_device.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698