You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2016/01/29 22:29:13 UTC

mesos git commit: Edited flag help strings for style.

Repository: mesos
Updated Branches:
  refs/heads/master 7518b3403 -> 7ead51800


Edited flag help strings for style.

Backticks were inserted where appropriate. This not only matches the convention
in the comments within our code, helps to enable the automatic generation of
markdown-formatted documentation from these help strings.

Review: https://reviews.apache.org/r/42936/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7ead5180
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7ead5180
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7ead5180

Branch: refs/heads/master
Commit: 7ead518003708c82e185897f1040603c6f6b4ea3
Parents: 7518b34
Author: Greg Mann <gr...@mesosphere.io>
Authored: Fri Jan 29 13:28:11 2016 -0800
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Jan 29 13:28:11 2016 -0800

----------------------------------------------------------------------
 src/logging/flags.cpp |  18 ++---
 src/master/flags.cpp  | 130 +++++++++++++++++------------------
 src/master/main.cpp   |  33 +++++----
 src/slave/flags.cpp   | 164 ++++++++++++++++++++++-----------------------
 src/slave/main.cpp    |  36 +++++-----
 5 files changed, 197 insertions(+), 184 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7ead5180/src/logging/flags.cpp
----------------------------------------------------------------------
diff --git a/src/logging/flags.cpp b/src/logging/flags.cpp
index 978d735..446eb92 100644
--- a/src/logging/flags.cpp
+++ b/src/logging/flags.cpp
@@ -26,10 +26,10 @@ mesos::internal::logging::Flags::Flags()
 
   add(&Flags::logging_level,
       "logging_level",
-      "Log message at or above this level.  Defaults to 'INFO'.\n"
-      "Possible values: 'INFO', 'WARNING', 'ERROR'.\n"
-      "If '--quiet' is specified, this will only affect the logs\n"
-      "written to '--log_dir', if specified.",
+      "Log message at or above this level.\n"
+      "Possible values: `INFO`, `WARNING`, `ERROR`.\n"
+      "If `--quiet` is specified, this will only affect the logs\n"
+      "written to `--log_dir`, if specified.",
       "INFO");
 
   add(&Flags::log_dir,
@@ -48,10 +48,10 @@ mesos::internal::logging::Flags::Flags()
 
   add(&Flags::initialize_driver_logging,
       "initialize_driver_logging",
-      "Whether the Master/Agent should initialize Google logging for the\n"
+      "Whether the master/slave should initialize Google logging for the\n"
       "Mesos scheduler and executor drivers, in same way as described here.\n"
       "The scheduler/executor drivers have separate logs and do not get\n"
-      "written to the Master/Agent logs.\n\n"
+      "written to the master/slave logs.\n\n"
       "This option has no effect when using the HTTP scheduler/executor APIs.\n"
       "By default, this option is true.",
       true);
@@ -62,8 +62,8 @@ mesos::internal::logging::Flags::Flags()
       "this file directly and merely exposes it in the WebUI and HTTP API.\n"
       "This is only useful when logging to stderr in combination with an\n"
       "external logging mechanism, like syslog or journald.\n\n"
-      "This option is meaningless when specified along with '--quiet'.\n\n"
-      "This option takes precedence over '--log_dir' in the WebUI.\n"
-      "However, logs will still be written to the '--log_dir' if\n"
+      "This option is meaningless when specified along with `--quiet`.\n\n"
+      "This option takes precedence over `--log_dir` in the WebUI.\n"
+      "However, logs will still be written to the `--log_dir` if\n"
       "that option is specified.");
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/7ead5180/src/master/flags.cpp
----------------------------------------------------------------------
diff --git a/src/master/flags.cpp b/src/master/flags.cpp
index 6e7e176..4a0e210 100644
--- a/src/master/flags.cpp
+++ b/src/master/flags.cpp
@@ -35,14 +35,14 @@ mesos::internal::master::Flags::Flags()
       "The hostname the master should advertise in ZooKeeper.\n"
       "If left unset, the hostname is resolved from the IP address\n"
       "that the slave binds to; unless the user explicitly prevents\n"
-      "that, using --no-hostname_lookup, in which case the IP itself\n"
+      "that, using `--no-hostname_lookup`, in which case the IP itself\n"
       "is used.");
 
   add(&Flags::hostname_lookup,
       "hostname_lookup",
       "Whether we should execute a lookup to find out the server's hostname,\n"
       "if not explicitly set (via, e.g., `--hostname`).\n"
-      "True by default; if set to 'false' it will cause Mesos\n"
+      "True by default; if set to `false` it will cause Mesos\n"
       "to use the IP address, unless the hostname is explicitly set.",
       true);
 
@@ -54,23 +54,24 @@ mesos::internal::master::Flags::Flags()
   add(&Flags::work_dir,
       "work_dir",
       "Directory path to store the persistent information stored in the \n"
-      "Registry. (example: /var/lib/mesos/master)");
+      "Registry. (example: `/var/lib/mesos/master`)");
 
-  // TODO(bmahler): Consider removing 'in_memory' as it was only
-  // used before 'replicated_log' was implemented.
+  // TODO(bmahler): Consider removing `in_memory` as it was only
+  // used before `replicated_log` was implemented.
   add(&Flags::registry,
       "registry",
       "Persistence strategy for the registry;\n"
-      "available options are 'replicated_log', 'in_memory' (for testing).",
+      "available options are `replicated_log`, `in_memory` (for testing).",
       "replicated_log");
 
   // TODO(vinod): Instead of specifying the quorum size consider
   // specifying the number of masters or the list of masters.
   add(&Flags::quorum,
       "quorum",
-      "The size of the quorum of replicas when using 'replicated_log' based\n"
+      "The size of the quorum of replicas when using `replicated_log` based\n"
       "registry. It is imperative to set this value to be a majority of\n"
-      "masters i.e., quorum > (number of masters)/2.");
+      "masters i.e., `quorum > (number of masters)/2`.\n"
+      "NOTE: Not required if master is run in standalone mode (non-HA).");
 
   add(&Flags::zk_session_timeout,
       "zk_session_timeout",
@@ -80,10 +81,10 @@ mesos::internal::master::Flags::Flags()
   // TODO(bmahler): Set the default to true in 0.20.0.
   add(&Flags::registry_strict,
       "registry_strict",
-      "Whether the Master will take actions based on the persistent\n"
+      "Whether the master will take actions based on the persistent\n"
       "information stored in the Registry. Setting this to false means\n"
       "that the Registrar will never reject the admission, readmission,\n"
-      "or removal of a slave. Consequently, 'false' can be used to\n"
+      "or removal of a slave. Consequently, `false` can be used to\n"
       "bootstrap the persistent state on a running cluster.\n"
       "NOTE: This flag is *experimental* and should not be used in\n"
       "production yet.",
@@ -118,8 +119,8 @@ mesos::internal::master::Flags::Flags()
         stringify(MIN_SLAVE_REREGISTER_TIMEOUT) + ".",
       MIN_SLAVE_REREGISTER_TIMEOUT);
 
-  // TODO(bmahler): Add a 'Percentage' abstraction for flags.
-  // TODO(bmahler): Add a --production flag for production defaults.
+  // TODO(bmahler): Add a `Percentage` abstraction for flags.
+  // TODO(bmahler): Add a `--production` flag for production defaults.
   add(&Flags::recovery_slave_removal_limit,
       "recovery_slave_removal_limit",
       "For failovers, limit on the percentage of slaves that can be removed\n"
@@ -127,7 +128,7 @@ mesos::internal::master::Flags::Flags()
       "elapses. If the limit is exceeded, the master will fail over rather\n"
       "than remove the slaves.\n"
       "This can be used to provide safety guarantees for production\n"
-      "environments. Production environments may expect that across Master\n"
+      "environments. Production environments may expect that across master\n"
       "failovers, at most a certain percentage of slaves will fail\n"
       "permanently (e.g. due to rack-level failures).\n"
       "Setting this limit would ensure that a human needs to get\n"
@@ -136,14 +137,14 @@ mesos::internal::master::Flags::Flags()
       "Values: [0%-100%]",
       stringify(RECOVERY_SLAVE_REMOVAL_PERCENT_LIMIT * 100.0) + "%");
 
-  // TODO(vinod): Add a 'Rate' abstraction in stout and the
+  // TODO(vinod): Add a `Rate` abstraction in stout and the
   // corresponding parser for flags.
   add(&Flags::slave_removal_rate_limit,
       "slave_removal_rate_limit",
-      "The maximum rate (e.g., 1/10mins, 2/3hrs, etc) at which slaves will\n"
-      "be removed from the master when they fail health checks. By default\n"
-      "slaves will be removed as soon as they fail the health checks.\n"
-      "The value is of the form <Number of slaves>/<Duration>.");
+      "The maximum rate (e.g., `1/10mins`, `2/3hrs`, etc) at which slaves\n"
+      "will be removed from the master when they fail health checks.\n"
+      "By default, slaves will be removed as soon as they fail the health\n"
+      "checks. The value is of the form `(Number of slaves)/(Duration)`.");
 
   add(&Flags::webui_dir,
       "webui_dir",
@@ -152,9 +153,11 @@ mesos::internal::master::Flags::Flags()
 
   add(&Flags::whitelist,
       "whitelist",
-      "Path to a file with a list of slaves\n"
-      "(one per line) to advertise offers for.\n"
-      "Path could be of the form 'file:///path/to/file' or '/path/to/file'.");
+      "Path to a file which contains a list of slaves (one per line) to\n"
+      "advertise offers for. The file is watched, and periodically re-read to\n"
+      "refresh the slave whitelist. By default there is no whitelist / all\n"
+      "machines are accepted. Path could be of the form\n"
+      "`file:///path/to/file` or `/path/to/file`.\n");
 
   add(&Flags::user_sorter,
       "user_sorter",
@@ -178,8 +181,7 @@ mesos::internal::master::Flags::Flags()
 
   add(&Flags::cluster,
       "cluster",
-      "Human readable name for the cluster,\n"
-      "displayed in the webui.");
+      "Human readable name for the cluster, displayed in the webui.");
 
   add(&Flags::roles,
       "roles",
@@ -190,38 +192,37 @@ mesos::internal::master::Flags::Flags()
   add(&Flags::weights,
       "weights",
       "A comma-separated list of role/weight pairs\n"
-      "of the form 'role=weight,role=weight'. Weights\n"
+      "of the form `role=weight,role=weight`. Weights\n"
       "are used to indicate forms of priority.");
 
   // TODO(adam-mesos): Deprecate --authenticate for --authenticate_frameworks.
   // See MESOS-4386 for details.
   add(&Flags::authenticate_frameworks,
       "authenticate",
-      "If authenticate is 'true' only authenticated frameworks are allowed\n"
-      "to register. If 'false' unauthenticated frameworks are also\n"
-      "allowed to register.",
+      "If `true`, only authenticated frameworks are allowed to register. If\n"
+      "`false`, unauthenticated frameworks are also allowed to register.",
       false);
 
   add(&Flags::authenticate_slaves,
       "authenticate_slaves",
-      "If 'true' only authenticated slaves are allowed to register.\n"
-      "If 'false' unauthenticated slaves are also allowed to register.",
+      "If `true`, only authenticated slaves are allowed to register.\n"
+      "If `false`, unauthenticated slaves are also allowed to register.",
       false);
 
   add(&Flags::authenticate_http,
       "authenticate_http",
-      "If 'true' only authenticated requests for HTTP endpoints supporting\n"
+      "If `true`, only authenticated requests for HTTP endpoints supporting\n"
       "authentication are allowed.\n"
-      "If 'false' unauthenticated HTTP endpoint requests are also allowed.\n",
+      "If `false`, unauthenticated HTTP endpoint requests are also allowed.\n",
       false);
 
   add(&Flags::credentials,
       "credentials",
       "Either a path to a text file with a list of credentials,\n"
-      "each line containing 'principal' and 'secret' separated by "
+      "each line containing `principal` and `secret` separated by "
       "whitespace,\n"
       "or, a path to a JSON-formatted file containing credentials.\n"
-      "Path could be of the form 'file:///path/to/file' or '/path/to/file'."
+      "Path could be of the form `file:///path/to/file` or `/path/to/file`."
       "\n"
       "JSON file Example:\n"
       "{\n"
@@ -239,11 +240,12 @@ mesos::internal::master::Flags::Flags()
       "acls",
       "The value could be a JSON-formatted string of ACLs\n"
       "or a file path containing the JSON-formatted ACLs used\n"
-      "for authorization. Path could be of the form 'file:///path/to/file'\n"
-      "or '/path/to/file'.\n"
+      "for authorization. Path could be of the form `file:///path/to/file`\n"
+      "or `/path/to/file`.\n"
       "\n"
-      "Note that if the flag --authorizers is provided with a value different\n"
-      "than '" + DEFAULT_AUTHORIZER + "', the ACLs contents will be ignored.\n"
+      "Note that if the flag `--authorizers` is provided with a value\n"
+      "different than `" + DEFAULT_AUTHORIZER + "`, the ACLs contents will be\n"
+      "ignored.\n"
       "\n"
       "See the ACLs protobuf in authorizer.proto for the expected format.\n"
       "\n"
@@ -285,10 +287,10 @@ mesos::internal::master::Flags::Flags()
       "firewall_rules",
       "The value could be a JSON-formatted string of rules or a\n"
       "file path containing the JSON-formatted rules used in the endpoints\n"
-      "firewall. Path must be of the form 'file:///path/to/file'\n"
-      "or '/path/to/file'.\n"
+      "firewall. Path must be of the form `file:///path/to/file`\n"
+      "or `/path/to/file`.\n"
       "\n"
-      "See the Firewall message in flags.proto for the expected format.\n"
+      "See the `Firewall` message in `flags.proto` for the expected format.\n"
       "\n"
       "Example:\n"
       "{\n"
@@ -305,8 +307,8 @@ mesos::internal::master::Flags::Flags()
       "The value could be a JSON-formatted string of rate limits\n"
       "or a file path containing the JSON-formatted rate limits used\n"
       "for framework rate limiting.\n"
-      "Path could be of the form 'file:///path/to/file'\n"
-      "or '/path/to/file'.\n"
+      "Path could be of the form `file:///path/to/file`\n"
+      "or `/path/to/file`.\n"
       "\n"
       "See the RateLimits protobuf in mesos.proto for the expected format.\n"
       "\n"
@@ -351,11 +353,11 @@ mesos::internal::master::Flags::Flags()
       "List of modules to be loaded and be available to the internal\n"
       "subsystems.\n"
       "\n"
-      "Use --modules=filepath to specify the list of modules via a\n"
-      "file containing a JSON-formatted string. 'filepath' can be\n"
-      "of the form 'file:///path/to/file' or '/path/to/file'.\n"
+      "Use `--modules=filepath` to specify the list of modules via a\n"
+      "file containing a JSON-formatted string. `filepath` can be\n"
+      "of the form `file:///path/to/file` or `/path/to/file`.\n"
       "\n"
-      "Use --modules=\"{...}\" to specify the list of modules inline.\n"
+      "Use `--modules=\"{...}\"` to specify the list of modules inline.\n"
       "\n"
       "Example:\n"
       "{\n"
@@ -391,15 +393,15 @@ mesos::internal::master::Flags::Flags()
   add(&Flags::authenticators,
       "authenticators",
       "Authenticator implementation to use when authenticating frameworks\n"
-      "and/or slaves. Use the default '" + DEFAULT_AUTHENTICATOR + "', or\n"
-      "load an alternate authenticator module using --modules.",
+      "and/or slaves. Use the default `" + DEFAULT_AUTHENTICATOR + "`, or\n"
+      "load an alternate authenticator module using `--modules`.",
       DEFAULT_AUTHENTICATOR);
 
   add(&Flags::allocator,
       "allocator",
       "Allocator to use for resource allocation to frameworks.\n"
-      "Use the default '" + DEFAULT_ALLOCATOR + "' allocator, or\n"
-      "load an alternate allocator module using --modules.",
+      "Use the default `" + DEFAULT_ALLOCATOR + "` allocator, or\n"
+      "load an alternate allocator module using `--modules`.",
       DEFAULT_ALLOCATOR);
 
   add(&Flags::hooks,
@@ -412,13 +414,13 @@ mesos::internal::master::Flags::Flags()
       "The timeout within which each slave is expected to respond to a\n"
       "ping from the master. Slaves that do not respond within\n"
       "max_slave_ping_timeouts ping retries will be asked to shutdown.\n"
-      "NOTE: The total ping timeout (slave_ping_timeout multiplied by\n"
-      "max_slave_ping_timeouts) should be greater than the ZooKeeper\n"
+      "NOTE: The total ping timeout (`slave_ping_timeout` multiplied by\n"
+      "`max_slave_ping_timeouts`) should be greater than the ZooKeeper\n"
       "session timeout to prevent useless re-registration attempts.\n",
       DEFAULT_SLAVE_PING_TIMEOUT,
       [](const Duration& value) -> Option<Error> {
         if (value < Seconds(1) || value > Minutes(15)) {
-          return Error("Expected --slave_ping_timeout to be between " +
+          return Error("Expected `--slave_ping_timeout` to be between " +
                        stringify(Seconds(1)) + " and " +
                        stringify(Minutes(15)));
         }
@@ -429,25 +431,25 @@ mesos::internal::master::Flags::Flags()
       "max_slave_ping_timeouts",
       "The number of times a slave can fail to respond to a\n"
       "ping from the master. Slaves that do not respond within\n"
-      "max_slave_ping_timeouts ping retries will be asked to shutdown.\n",
+      "`max_slave_ping_timeouts` ping retries will be asked to shutdown.\n",
       DEFAULT_MAX_SLAVE_PING_TIMEOUTS,
       [](size_t value) -> Option<Error> {
         if (value < 1) {
-          return Error("Expected --max_slave_ping_timeouts to be at least 1");
+          return Error("Expected `--max_slave_ping_timeouts` to be at least 1");
         }
         return None();
       });
 
   add(&Flags::authorizers,
       "authorizers",
-      "Authorizer implementation to use when authorizating actions that\n"
-      "required it.\n"
-      "Use the default '" + DEFAULT_AUTHORIZER + "', or\n"
-      "load an alternate authorizer module using --modules.\n"
+      "Authorizer implementation to use when authorizing actions that\n"
+      "require it.\n"
+      "Use the default `" + DEFAULT_AUTHORIZER + "`, or\n"
+      "load an alternate authorizer module using `--modules`.\n"
       "\n"
-      "Note that if the flag --authorizers is provided with a value different\n"
-      "than the default '" + DEFAULT_AUTHORIZER + "', the ACLs passed\n"
-      "through the --acls flag will be ignored.\n"
+      "Note that if the flag `--authorizers` is provided with a value\n"
+      "different than the default `" + DEFAULT_AUTHORIZER + "`, the ACLs\n"
+      "passed through the `--acls` flag will be ignored.\n"
       "\n"
       "Currently there's no support for multiple authorizers.",
       DEFAULT_AUTHORIZER);
@@ -456,8 +458,8 @@ mesos::internal::master::Flags::Flags()
       "http_authenticators",
       "HTTP authenticator implementation to use when handling requests to\n"
       "authenticated endpoints. Use the default\n"
-      "'" + DEFAULT_HTTP_AUTHENTICATOR + "', or load an alternate HTTP\n"
-      "authenticator module using --modules.\n"
+      "`" + DEFAULT_HTTP_AUTHENTICATOR + "`, or load an alternate HTTP\n"
+      "authenticator module using `--modules`.\n"
       "\n"
       "Currently there is no support for multiple HTTP authenticators.",
       DEFAULT_HTTP_AUTHENTICATOR);

http://git-wip-us.apache.org/repos/asf/mesos/blob/7ead5180/src/master/main.cpp
----------------------------------------------------------------------
diff --git a/src/master/main.cpp b/src/master/main.cpp
index 0d5ac49..7ebca78 100644
--- a/src/master/main.cpp
+++ b/src/master/main.cpp
@@ -121,10 +121,16 @@ int main(int argc, char** argv)
   // have one instance of libprocess per execution, we only want to
   // advertise the IP and port option once, here).
   Option<string> ip;
-  flags.add(&ip, "ip", "IP address to listen on");
+  flags.add(&ip,
+            "ip",
+            "IP address to listen on. This cannot be used in conjunction\n"
+            "with `--ip_discovery_command`.");
 
   uint16_t port;
-  flags.add(&port, "port", "Port to listen on", MasterInfo().port());
+  flags.add(&port,
+            "port",
+            "Port to listen on.",
+            MasterInfo().port());
 
   Option<string> advertise_ip;
   flags.add(&advertise_ip,
@@ -136,9 +142,9 @@ int main(int argc, char** argv)
   Option<string> advertise_port;
   flags.add(&advertise_port,
             "advertise_port",
-            "Port advertised to reach mesos master (alongwith advertise_ip).\n"
-            "Mesos master does not bind using this port.\n"
-            "However, this port (alongwith advertise_ip) may be used to\n"
+            "Port advertised to reach mesos master (along with\n"
+            "`advertise_ip`). Mesos master does not bind using this port.\n"
+            "However, this port (along with `advertise_ip`) may be used to\n"
             "access Mesos master.");
 
   Option<string> zk;
@@ -146,18 +152,19 @@ int main(int argc, char** argv)
             "zk",
             "ZooKeeper URL (used for leader election amongst masters)\n"
             "May be one of:\n"
-            "  zk://host1:port1,host2:port2,.../path\n"
-            "  zk://username:password@host1:port1,host2:port2,.../path\n"
-            "  file:///path/to/file (where file contains one of the above)");
+            "  `zk://host1:port1,host2:port2,.../path`\n"
+            "  `zk://username:password@host1:port1,host2:port2,.../path`\n"
+            "  `file:///path/to/file` (where file contains one of the above)\n"
+            "NOTE: Not required if master is run in standalone mode (non-HA).");
 
   // Optional IP discover script that will set the Master IP.
   // If set, its output is expected to be a valid parseable IP string.
   Option<string> ip_discovery_command;
   flags.add(&ip_discovery_command,
-      "ip_discovery_command",
-      "Optional IP discovery binary: if set, it is expected to emit\n"
-      "the IP address which Master will try to bind to.\n"
-      "Cannot be used in conjunction with --ip.");
+            "ip_discovery_command",
+            "Optional IP discovery binary: if set, it is expected to emit\n"
+            "the IP address which the master will try to bind to.\n"
+            "Cannot be used in conjunction with `--ip`.");
 
   Try<Nothing> load = flags.load("MESOS_", argc, argv);
 
@@ -195,7 +202,7 @@ int main(int argc, char** argv)
 
   if (ip_discovery_command.isSome() && ip.isSome()) {
     EXIT(EXIT_FAILURE) << flags.usage(
-        "Only one of --ip or --ip_discovery_command should be specified");
+        "Only one of `--ip` or `--ip_discovery_command` should be specified");
   }
 
   if (ip_discovery_command.isSome()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/7ead5180/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index 75d7429..24a2332 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -35,14 +35,14 @@ mesos::internal::slave::Flags::Flags()
       "The hostname the slave should report.\n"
       "If left unset, the hostname is resolved from the IP address\n"
       "that the slave binds to; unless the user explicitly prevents\n"
-      "that, using --no-hostname_lookup, in which case the IP itself\n"
+      "that, using `--no-hostname_lookup`, in which case the IP itself\n"
       "is used.");
 
   add(&Flags::hostname_lookup,
       "hostname_lookup",
       "Whether we should execute a lookup to find out the server's hostname,\n"
       "if not explicitly set (via, e.g., `--hostname`).\n"
-      "True by default; if set to 'false' it will cause Mesos\n"
+      "True by default; if set to `false` it will cause Mesos\n"
       "to use the IP address, unless the hostname is explicitly set.",
       true);
 
@@ -59,12 +59,12 @@ mesos::internal::slave::Flags::Flags()
       "optionally specified.\n"
       "\n"
       "As a key:value list:\n"
-      "name(role):value;name:value...\n"
+      "`name(role):value;name:value...`\n"
       "\n"
-      "To use JSON, pass a JSON-formatted string or use --resources=filepath\n"
-      "to specify the resources via a file containing a JSON-formatted\n"
-      "string. 'filepath' can be of the form 'file:///path/to/file' or\n"
-      "'/path/to/file'.\n"
+      "To use JSON, pass a JSON-formatted string or use\n"
+      "`--resources=filepath` to specify the resources via a file containing\n"
+      "a JSON-formatted string. `filepath` can be of the form\n"
+      "`file:///path/to/file` or `/path/to/file`.\n"
       "\n"
       "Example JSON:\n"
       "[\n"
@@ -86,18 +86,18 @@ mesos::internal::slave::Flags::Flags()
 
   add(&Flags::isolation,
       "isolation",
-      "Isolation mechanisms to use, e.g., 'posix/cpu,posix/mem', or\n"
-      "'cgroups/cpu,cgroups/mem', or network/port_mapping\n"
-      "(configure with flag: --with-network-isolator to enable),\n"
-      "or 'external', or load an alternate isolator module using\n"
-      "the --modules flag. Note that this flag is only relevant\n"
+      "Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or\n"
+      "`cgroups/cpu,cgroups/mem`, or network/port_mapping\n"
+      "(configure with flag: `--with-network-isolator` to enable),\n"
+      "or `external`, or load an alternate isolator module using\n"
+      "the `--modules` flag. Note that this flag is only relevant\n"
       "for the Mesos Containerizer.",
       "posix/cpu,posix/mem");
 
   add(&Flags::launcher,
       "launcher",
       "The launcher to be used for Mesos containerizer. It could either be\n"
-      "'linux' or 'posix'. The Linux launcher is required for cgroups\n"
+      "`linux` or `posix`. The Linux launcher is required for cgroups\n"
       "isolation and for any isolators that require Linux namespaces such as\n"
       "network, pid, etc. If unspecified, the slave will choose the Linux\n"
       "launcher if it's running as root on Linux.");
@@ -105,17 +105,17 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::image_providers,
       "image_providers",
       "Comma-separated list of supported image providers,\n"
-      "e.g., 'APPC,DOCKER'.");
+      "e.g., `APPC,DOCKER`.");
 
   add(&Flags::image_provisioner_backend,
       "image_provisioner_backend",
       "Strategy for provisioning container rootfs from images,\n"
-      "e.g., 'bind', 'copy'.",
+      "e.g., `bind`, `copy`.",
       "copy");
 
   add(&Flags::appc_store_dir,
       "appc_store_dir",
-      "Directory the appc provisioner will store images in.",
+      "Directory the appc provisioner will store images in.\n",
       "/tmp/mesos/store/appc");
 
   add(&Flags::docker_auth_server,
@@ -131,9 +131,9 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::docker_registry,
       "docker_registry",
       "The default url for pulling Docker images. It could either be a Docker\n"
-      "registry server url (i.e: https://registry.docker.io), or a local path\n"
-      "(i.e: file:///tmp/docker/images) in which Docker image archives\n"
-      "(result of 'docker save') are stored.",
+      "registry server url (i.e: `https://registry.docker.io`), or a local\n"
+      "path (i.e: `file:///tmp/docker/images`) in which Docker image archives\n"
+      "(result of `docker save`) are stored.",
       "https://registry-1.docker.io");
 
   add(&Flags::docker_store_dir,
@@ -143,17 +143,17 @@ mesos::internal::slave::Flags::Flags()
 
   add(&Flags::default_role,
       "default_role",
-      "Any resources in the --resources flag that\n"
+      "Any resources in the `--resources` flag that\n"
       "omit a role, as well as any resources that\n"
-      "are not present in --resources but that are\n"
+      "are not present in `--resources` but that are\n"
       "automatically detected, will be assigned to\n"
       "this role.",
       "*");
 
   add(&Flags::attributes,
       "attributes",
-      "Attributes of machine, in the form:\n"
-      "rack:2 or 'rack:2;u:1'");
+      "Attributes of the slave machine, in the form:\n"
+      "`rack:2` or `rack:2;u:1`");
 
   add(&Flags::fetcher_cache_size,
       "fetcher_cache_size",
@@ -189,21 +189,21 @@ mesos::internal::slave::Flags::Flags()
       "hadoop_home",
       "Path to find Hadoop installed (for\n"
       "fetching framework executors from HDFS)\n"
-      "(no default, look for HADOOP_HOME in\n"
-      "environment or find hadoop on PATH)",
+      "(no default, look for `HADOOP_HOME` in\n"
+      "environment or find hadoop on `PATH`)",
       "");
 
 #ifndef __WINDOWS__
   add(&Flags::switch_user,
       "switch_user",
-      "If set to `true`, the agent will attempt to run tasks as\n"
+      "If set to `true`, the slave will attempt to run tasks as\n"
       "the `user` who submitted them (as defined in `FrameworkInfo`)\n"
       "(this requires `setuid` permission and that the given `user`\n"
-      "exists on the agent).\n"
+      "exists on the slave).\n"
       "If the user does not exist, an error occurs and the task will fail.\n"
       "If set to `false`, tasks will be run as the same user as the Mesos\n"
-      "agent process.\n"
-      "NOTE: This feature is not yet supported on Windows agents, and\n"
+      "slave process.\n"
+      "NOTE: This feature is not yet supported on Windows slave, and\n"
       "therefore the flag currently does not exist on that platform.",
       true);
 #endif // __WINDOWS__
@@ -214,22 +214,20 @@ mesos::internal::slave::Flags::Flags()
 
   add(&Flags::registration_backoff_factor,
       "registration_backoff_factor",
-      "Slave initially picks a random amount of time between [0, b], where\n"
-      "b = registration_backoff_factor, to (re-)register with a new master.\n"
+      "slave initially picks a random amount of time between `[0, b]`, where\n"
+      "`b = registration_backoff_factor`, to (re-)register with a new master.\n"
       "Subsequent retries are exponentially backed off based on this\n"
-      "interval (e.g., 1st retry uses a random value between [0, b * 2^1],\n"
-      "2nd retry between [0, b * 2^2], 3rd retry between [0, b * 2^3] etc)\n"
-      "up to a maximum of " +
+      "interval (e.g., 1st retry uses a random value between `[0, b * 2^1]`,\n"
+      "2nd retry between `[0, b * 2^2]`, 3rd retry between `[0, b * 2^3]`,\n"
+      "etc) up to a maximum of " +
         stringify(REGISTER_RETRY_INTERVAL_MAX),
       DEFAULT_REGISTRATION_BACKOFF_FACTOR);
 
   add(&Flags::executor_environment_variables,
       "executor_environment_variables",
-      "JSON object representing the environment\n"
-      "variables that should be passed to the\n"
-      "executor, and thus subsequently task(s).\n"
-      "By default the executor will inherit the\n"
-      "slave's environment variables.\n"
+      "JSON object representing the environment variables that should be\n"
+      "passed to the executor, and thus subsequently task(s). By default the\n"
+      "executor will inherit the slave's environment variables.\n"
       "Example:\n"
       "{\n"
       "  \"PATH\": \"/bin:/usr/bin\",\n"
@@ -239,7 +237,7 @@ mesos::internal::slave::Flags::Flags()
         if (object.isSome()) {
           foreachvalue (const JSON::Value& value, object.get().values) {
             if (!value.is<JSON::String>()) {
-              return Error("'executor_environment_variables' must "
+              return Error("`executor_environment_variables` must "
                            "only contain string values");
             }
           }
@@ -272,8 +270,8 @@ mesos::internal::slave::Flags::Flags()
       "gc_disk_headroom",
       "Adjust disk headroom used to calculate maximum executor\n"
       "directory age. Age is calculated by:\n"
-      "gc_delay * max(0.0, (1.0 - gc_disk_headroom - disk usage))\n"
-      "every --disk_watch_interval duration. gc_disk_headroom must\n"
+      "`gc_delay * max(0.0, (1.0 - gc_disk_headroom - disk usage))`\n"
+      "every `--disk_watch_interval` duration. `gc_disk_headroom` must\n"
       "be a value between 0.0 and 1.0",
       GC_DISK_HEADROOM);
 
@@ -289,13 +287,13 @@ mesos::internal::slave::Flags::Flags()
       "container_logger",
       "The name of the container logger to use for logging container\n"
       "(i.e., executor and task) stdout and stderr. The default\n"
-      "container logger writes to 'stdout' and 'stderr' files\n"
+      "container logger writes to `stdout` and `stderr` files\n"
       "in the sandbox directory.");
 
   add(&Flags::recover,
       "recover",
       "Whether to recover status updates and reconnect with old executors.\n"
-      "Valid values for 'recover' are\n"
+      "Valid values for `recover` are\n"
       "reconnect: Reconnect with any old live executors.\n"
       "cleanup  : Kill any old live executors and exit.\n"
       "           Use this option when doing an incompatible slave\n"
@@ -311,8 +309,8 @@ mesos::internal::slave::Flags::Flags()
 
   add(&Flags::strict,
       "strict",
-      "If strict=true, any and all recovery errors are considered fatal.\n"
-      "If strict=false, any expected errors (e.g., slave cannot recover\n"
+      "If `strict=true`, any and all recovery errors are considered fatal.\n"
+      "If `strict=false`, any expected errors (e.g., slave cannot recover\n"
       "information about an executor, because the slave died right before\n"
       "the executor registered.) during recovery are ignored and as much\n"
       "state as possible is recovered.\n",
@@ -350,7 +348,7 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::slave_subsystems,
       "slave_subsystems",
       "List of comma-separated cgroup subsystems to run the slave binary\n"
-      "in, e.g., 'memory,cpuacct'. The default is none.\n"
+      "in, e.g., `memory,cpuacct`. The default is none.\n"
       "Present functionality is intended for resource monitoring and\n"
       "no cgroup limits are set, they are inherited from the root mesos\n"
       "cgroup.");
@@ -359,24 +357,24 @@ mesos::internal::slave::Flags::Flags()
       "perf_events",
       "List of command-separated perf events to sample for each container\n"
       "when using the perf_event isolator. Default is none.\n"
-      "Run command 'perf list' to see all events. Event names are\n"
+      "Run command `perf list` to see all events. Event names are\n"
       "sanitized by downcasing and replacing hyphens with underscores\n"
-      "when reported in the PerfStatistics protobuf, e.g., cpu-cycles\n"
-      "becomes cpu_cycles; see the PerfStatistics protobuf for all names.");
+      "when reported in the PerfStatistics protobuf, e.g., `cpu-cycles`\n"
+      "becomes `cpu_cycles`; see the PerfStatistics protobuf for all names.");
 
   add(&Flags::perf_interval,
       "perf_interval",
       "Interval between the start of perf stat samples. Perf samples are\n"
-      "obtained periodically according to perf_interval and the most\n"
+      "obtained periodically according to `perf_interval` and the most\n"
       "recently obtained sample is returned rather than sampling on\n"
-      "demand. For this reason, perf_interval is independent of the\n"
+      "demand. For this reason, `perf_interval` is independent of the\n"
       "resource monitoring interval",
       Seconds(60));
 
   add(&Flags::perf_duration,
       "perf_duration",
       "Duration of a perf stat sample. The duration must be less\n"
-      "than the perf_interval.",
+      "than the `perf_interval`.",
       Seconds(10));
 
   add(&Flags::revocable_cpu_low_priority,
@@ -396,10 +394,10 @@ mesos::internal::slave::Flags::Flags()
       "firewall_rules",
       "The value could be a JSON-formatted string of rules or a\n"
       "file path containing the JSON-formatted rules used in the endpoints\n"
-      "firewall. Path must be of the form 'file:///path/to/file'\n"
-      "or '/path/to/file'.\n"
+      "firewall. Path must be of the form `file:///path/to/file`\n"
+      "or `/path/to/file`.\n"
       "\n"
-      "See the Firewall message in flags.proto for the expected format.\n"
+      "See the `Firewall` message in `flags.proto` for the expected format.\n"
       "\n"
       "Example:\n"
       "{\n"
@@ -414,11 +412,11 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::credential,
       "credential",
       "Either a path to a text with a single line\n"
-      "containing 'principal' and 'secret' separated by "
+      "containing `principal` and `secret` separated by "
       "whitespace.\n"
       "Or a path containing the JSON-formatted "
       "information used for one credential.\n"
-      "Path could be of the form 'file:///path/to/file' or '/path/to/file'."
+      "Path could be of the form `file:///path/to/file` or `/path/to/file`."
       "\n"
       "Example:\n"
       "{\n"
@@ -429,16 +427,15 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::containerizer_path,
       "containerizer_path",
       "The path to the external containerizer executable used when\n"
-      "external isolation is activated (--isolation=external).");
+      "external isolation is activated (`--isolation=external`).");
 
   add(&Flags::containerizers,
       "containerizers",
       "Comma-separated list of containerizer implementations\n"
       "to compose in order to provide containerization.\n"
-      "Available options are 'mesos', 'external', and\n"
-      "'docker' (on Linux). The order the containerizers\n"
-      "are specified is the order they are tried\n"
-      "(--containerizers=mesos).\n",
+      "Available options are `mesos`, `external`, and\n"
+      "`docker` (on Linux). The order the containerizers\n"
+      "are specified is the order they are tried.\n",
       "mesos");
 
   add(&Flags::default_container_image,
@@ -456,7 +453,7 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::docker_remove_delay,
       "docker_remove_delay",
       "The amount of time to wait before removing docker containers\n"
-      "(e.g., 3days, 2weeks, etc).\n",
+      "(e.g., `3days`, `2weeks`, etc).\n",
       DOCKER_REMOVE_DELAY);
 
   add(&Flags::docker_kill_orphans,
@@ -519,21 +516,21 @@ mesos::internal::slave::Flags::Flags()
       "ephemeral_ports_per_container",
       "Number of ephemeral ports allocated to a container by the network\n"
       "isolator. This number has to be a power of 2. This flag is used\n"
-      "for the 'network/port_mapping' isolator.",
+      "for the `network/port_mapping` isolator.",
       DEFAULT_EPHEMERAL_PORTS_PER_CONTAINER);
 
   add(&Flags::eth0_name,
       "eth0_name",
-      "The name of the public network interface (e.g., eth0). If it is\n"
+      "The name of the public network interface (e.g., `eth0`). If it is\n"
       "not specified, the network isolator will try to guess it based\n"
       "on the host default gateway. This flag is used for the\n"
-      "'network/port_mapping' isolator.");
+      "`network/port_mapping` isolator.");
 
   add(&Flags::lo_name,
       "lo_name",
       "The name of the loopback network interface (e.g., lo). If it is\n"
       "not specified, the network isolator will try to guess it. This\n"
-      "flag is used for the 'network/port_mapping' isolator.");
+      "flag is used for the `network/port_mapping` isolator.");
 
   add(&Flags::egress_rate_limit_per_container,
       "egress_rate_limit_per_container",
@@ -541,18 +538,18 @@ mesos::internal::slave::Flags::Flags()
       "If not specified or specified as zero, the network isolator will\n"
       "impose no limits to containers' egress traffic throughput.\n"
       "This flag uses the Bytes type (defined in stout) and is used for\n"
-      "the 'network/port_mapping' isolator.");
+      "the `network/port_mapping` isolator.");
 
   add(&Flags::egress_unique_flow_per_container,
       "egress_unique_flow_per_container",
       "Whether to assign an individual flow for each container for the\n"
-      "egress traffic. This flag is used for the 'network/port_mapping'\n"
+      "egress traffic. This flag is used for the `network/port_mapping`\n"
       "isolator.",
       false);
 
   add(&Flags::egress_flow_classifier_parent,
       "egress_flow_classifier_parent",
-      "When egress_unique_flow_per_container is enabled, we need to install\n"
+      "When `egress_unique_flow_per_container` is enabled, we need to install\n"
       "a flow classifier (fq_codel) qdisc on egress side. This flag specifies\n"
       "where to install it in the hierarchy. By default, we install it at\n"
       "root.",
@@ -561,13 +558,13 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::network_enable_socket_statistics_summary,
       "network_enable_socket_statistics_summary",
       "Whether to collect socket statistics summary for each container.\n"
-      "This flag is used for the 'network/port_mapping' isolator.",
+      "This flag is used for the `network/port_mapping` isolator.",
       false);
 
   add(&Flags::network_enable_socket_statistics_details,
       "network_enable_socket_statistics_details",
       "Whether to collect socket statistics details (e.g., TCP RTT) for\n"
-      "each container. This flag is used for the 'network/port_mapping'\n"
+      "each container. This flag is used for the `network/port_mapping`\n"
       "isolator.",
       false);
 
@@ -576,7 +573,7 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::container_disk_watch_interval,
       "container_disk_watch_interval",
       "The interval between disk quota checks for containers. This flag is\n"
-      "used for the 'posix/disk' isolator.",
+      "used for the `posix/disk` isolator.",
       Seconds(15));
 
   // TODO(jieyu): Consider enabling this flag by default. Remember
@@ -584,7 +581,7 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::enforce_container_disk_quota,
       "enforce_container_disk_quota",
       "Whether to enable disk quota enforcement for containers. This flag\n"
-      "is used for the 'posix/disk' isolator.",
+      "is used for the `posix/disk` isolator.",
       false);
 
   // This help message for --modules flag is the same for
@@ -597,11 +594,11 @@ mesos::internal::slave::Flags::Flags()
       "List of modules to be loaded and be available to the internal\n"
       "subsystems.\n"
       "\n"
-      "Use --modules=filepath to specify the list of modules via a\n"
-      "file containing a JSON-formatted string. 'filepath' can be\n"
-      "of the form 'file:///path/to/file' or '/path/to/file'.\n"
+      "Use `--modules=filepath` to specify the list of modules via a\n"
+      "file containing a JSON-formatted string. `filepath` can be\n"
+      "of the form `file:///path/to/file` or `/path/to/file`.\n"
       "\n"
-      "Use --modules=\"{...}\" to specify the list of modules inline.\n"
+      "Use `--modules=\"{...}\"` to specify the list of modules inline.\n"
       "\n"
       "Example:\n"
       "{\n"
@@ -637,10 +634,10 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::authenticatee,
       "authenticatee",
       "Authenticatee implementation to use when authenticating against the\n"
-      "master. Use the default '" +
+      "master. Use the default `" +
         DEFAULT_AUTHENTICATEE +
-        "', or\n"
-        "load an alternate authenticatee module using --modules.",
+        "`, or\n"
+        "load an alternate authenticatee module using `--modules`.",
       DEFAULT_AUTHENTICATEE);
 
   add(&Flags::hooks,
@@ -668,6 +665,7 @@ mesos::internal::slave::Flags::Flags()
       "oversubscribed_resources_interval",
       "The slave periodically updates the master with the current estimation\n"
       "about the total amount of oversubscribed resources that are allocated\n"
-      "and available. The interval between updates is controlled by this flag.",
+      "and available. The interval between updates is controlled by this\n"
+      "flag.",
       Seconds(15));
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/7ead5180/src/slave/main.cpp
----------------------------------------------------------------------
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index 9d48a08..a412ceb 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -94,10 +94,16 @@ int main(int argc, char** argv)
   // have one instance of libprocess per execution, we only want to
   // advertise the IP and port option once, here).
   Option<string> ip;
-  flags.add(&ip, "ip", "IP address to listen on");
+  flags.add(&ip,
+            "ip",
+            "IP address to listen on. This cannot be used in conjunction\n"
+            "with `--ip_discovery_command`.");
 
   uint16_t port;
-  flags.add(&port, "port", "Port to listen on", SlaveInfo().port());
+  flags.add(&port,
+            "port",
+            "Port to listen on.",
+            SlaveInfo().port());
 
   Option<string> advertise_ip;
   flags.add(&advertise_ip,
@@ -109,29 +115,29 @@ int main(int argc, char** argv)
   Option<string> advertise_port;
   flags.add(&advertise_port,
             "advertise_port",
-            "Port advertised to reach mesos slave (alongwith advertise_ip).\n"
-            "Mesos slave does not bind using this port.\n"
-            "However, this port (alongwith advertise_ip) may be used to\n"
+            "Port advertised to reach mesos slave (along with\n"
+            "`advertise_ip`). Mesos slave does not bind using this port.\n"
+            "However, this port (along with `advertise_ip`) may be used to\n"
             "access Mesos slave.");
 
   Option<string> master;
   flags.add(&master,
             "master",
             "May be one of:\n"
-            "  host:port\n"
-            "  zk://host1:port1,host2:port2,.../path\n"
-            "  zk://username:password@host1:port1,host2:port2,.../path\n"
-            "  file:///path/to/file (where file contains one of the above)");
+            "  `host:port`\n"
+            "  `zk://host1:port1,host2:port2,.../path`\n"
+            "  `zk://username:password@host1:port1,host2:port2,.../path`\n"
+            "  `file:///path/to/file` (where file contains one of the above)");
 
 
   // Optional IP discover script that will set the slave's IP.
   // If set, its output is expected to be a valid parseable IP string.
   Option<string> ip_discovery_command;
   flags.add(&ip_discovery_command,
-      "ip_discovery_command",
-      "Optional IP discovery binary: if set, it is expected to emit\n"
-      "the IP address which slave will try to bind to.\n"
-      "Cannot be used in conjunction with --ip.");
+            "ip_discovery_command",
+            "Optional IP discovery binary: if set, it is expected to emit\n"
+            "the IP address which the slave will try to bind to.\n"
+            "Cannot be used in conjunction with `--ip`.");
 
   Try<Nothing> load = flags.load("MESOS_", argc, argv);
 
@@ -153,7 +159,7 @@ int main(int argc, char** argv)
   }
 
   if (master.isNone()) {
-    cerr << flags.usage("Missing required option --master") << endl;
+    cerr << flags.usage("Missing required option `--master`") << endl;
     return EXIT_FAILURE;
   }
 
@@ -177,7 +183,7 @@ int main(int argc, char** argv)
   // Initialize libprocess.
   if (ip_discovery_command.isSome() && ip.isSome()) {
     EXIT(EXIT_FAILURE) << flags.usage(
-        "Only one of --ip or --ip_discovery_command should be specified");
+        "Only one of `--ip` or `--ip_discovery_command` should be specified");
   }
 
   if (ip_discovery_command.isSome()) {