[
https://issues.apache.org/jira/browse/MESOS-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14569196#comment-14569196
]
Benjamin Hindman commented on MESOS-2766:
-----------------------------------------
[~marco-mesos] and I had discussed how flag validation might be able to help
with this as well. I pulled out some old code of mine that did flag validation
[here|https://reviews.apache.org/r/34943] and what the resulting validator for
--help would look like [here|https://reviews.apache.org/r/34944]. I think we
could run with some of this stuff and clean up a lot of redundant code. I also
think we could create a validator that everyone could reuse for required
options instead of having to require each person rewrite it as a lambda (that
also deserves its own JIRA issue).
> Add to FlagsBase the default --help behavior
> --------------------------------------------
>
> Key: MESOS-2766
> URL: https://issues.apache.org/jira/browse/MESOS-2766
> Project: Mesos
> Issue Type: Bug
> Components: stout
> Reporter: Marco Massenzio
> Assignee: Anand Mazumdar
> Priority: Minor
> Labels: tech-debt
>
> In every "launcher" file (ie, those containing some variation on {{main()}})
> there is a minor variation on:
> {code}
> if (flags.help) {
> cout << flags.usage() << endl;
> // arguably this is not an error: the user asked for help,
> // and she got it: // the program execution ought to be
> // considered successful.
> return EXIT_SUCCESS;
> }
> {code}
> As this is default behavior, and we've added support for the {{--help}} flag
> in the {{FlagsBase}} class, we should add this too there and remove it from
> everywhere else.
> This follows the DRY principle.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)