diff options
author | maksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-03 03:48:18 +0000 |
---|---|---|
committer | maksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-03 03:48:18 +0000 |
commit | 5e56cfa664e8a65dbbedd0ad7971c22e5aca1a75 (patch) | |
tree | b83f451d8c6434bc373125af4f33eaa9218b0de8 /cloud_print | |
parent | d2f33eeff4ff742c3f827e10e1ba003c2b7787e5 (diff) | |
download | chromium_src-5e56cfa664e8a65dbbedd0ad7971c22e5aca1a75.zip chromium_src-5e56cfa664e8a65dbbedd0ad7971c22e5aca1a75.tar.gz chromium_src-5e56cfa664e8a65dbbedd0ad7971c22e5aca1a75.tar.bz2 |
GCP2.0 Device: Help message
BUG=
Review URL: https://chromiumcodereview.appspot.com/21407002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215477 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print')
-rw-r--r-- | cloud_print/gcp20/prototype/gcp20_device.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cloud_print/gcp20/prototype/gcp20_device.cc b/cloud_print/gcp20/prototype/gcp20_device.cc index 31025ab..e26d45a 100644 --- a/cloud_print/gcp20/prototype/gcp20_device.cc +++ b/cloud_print/gcp20/prototype/gcp20_device.cc @@ -16,6 +16,31 @@ 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" + " --multicast-respond DNS responses will be sent in multicast " + "instead of unicast\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" + " --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); @@ -48,6 +73,12 @@ 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(); + return 0; + } + signal(SIGINT, OnAbort); // Handle Ctrl+C signal. base::MessageLoop loop(base::MessageLoop::TYPE_IO); |