You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Shuai Lin (JIRA)" <ji...@apache.org> on 2015/11/22 14:14:11 UTC

[jira] [Commented] (MESOS-3818) Line wrapping for "--help" output

    [ https://issues.apache.org/jira/browse/MESOS-3818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15020988#comment-15020988 ] 

Shuai Lin commented on MESOS-3818:
----------------------------------

My first thought is to edit the help strings if the files master/flags.cpp, slave/flags.cpp , but after I edited a few lines of it I think a better way is to improve the {{Flags::usage()}} to automatically formatting the output of the usage strings.

So the idea is:

* Remove all the newlines in the help strings, like in the next statement:
{code:title=flags.cpp|borderStyle=solid}
add(&Flags::hostname,                                            ==>      add(&Flags::hostname,                                                  
    "hostname",                                                              "hostname",
    "The hostname the master should advertise in ZooKeeper. If\n"            "The hostname the master should advertise in ZooKeeper. If "
    "left unset, the hostname is resolved from the IP address\n"             "left unset, the hostname is resolved from the IP address "
    "that the slave binds to; unless the user explicitly \n"                 "that the slave binds to; unless the user explicitly  "
    "prevents that, using --no-hostname_lookup, in which case\n"             "prevents that, using --no-hostname_lookup, in which case "
    "the IP itself is used.");                                               "the IP itself is used.");
{code}
* Automatcially insert line breaks to pretty-format the usage string, so that each line would wrap around the same line length.
* All lietral {{'\n'}} character in the help string would force a new line, this could be helpful when we want to start the next setence in a new line, or even create a blank line to make the help more readable , for example:
{code}
  --rate_limits=VALUE                      The value could be a JSON-formatted string of rate limits
                                           or a file path containing the JSON-formatted rate limits used
                                           for framework rate limiting.
                                           Path could be of the form 'file:///path/to/file'
                                           or '/path/to/file'.
                                           
                                           See the RateLimits protobuf in mesos.proto for the expected format.
                                           
                                           Example:
                                           {
                                             "limits": [
                                               {
                                                 "principal": "foo",
                                                 "qps": 55.5
                                               },
                                               {
                                                 "principal": "bar"
                                               }
                                             ],
                                             "aggregate_default_qps": 33.3
                                           }
{code}

[~neilconway] What do you think?

> Line wrapping for "--help" output
> ---------------------------------
>
>                 Key: MESOS-3818
>                 URL: https://issues.apache.org/jira/browse/MESOS-3818
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Neil Conway
>            Assignee: Shuai Lin
>            Priority: Trivial
>              Labels: mesosphere, newbie
>
> The output of `mesos-slave --help`, `mesos-master --help`, and perhaps other programs has very inconsistent line wrapping: different help text fragments are wrapped at very different column numbers, which harms readability.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)