Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C6518189B0 for ; Thu, 28 May 2015 22:33:50 +0000 (UTC) Received: (qmail 71443 invoked by uid 500); 28 May 2015 22:33:50 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 71419 invoked by uid 500); 28 May 2015 22:33:50 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 71405 invoked by uid 99); 28 May 2015 22:33:50 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 22:33:50 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 1CA4C1DDAC6; Thu, 28 May 2015 22:33:49 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============5636066992250361774==" MIME-Version: 1.0 Subject: Re: Review Request 34193: Refactored common functionality into FlagsBase From: "Marco Massenzio" To: "Joris Van Remoortere" , "Benjamin Hindman" Cc: "Marco Massenzio" , "mesos" Date: Thu, 28 May 2015 22:33:49 -0000 Message-ID: <20150528223349.8660.64216@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Marco Massenzio" X-ReviewGroup: mesos X-ReviewRequest-URL: https://reviews.apache.org/r/34193/ X-Sender: "Marco Massenzio" References: <20150528114548.8660.77258@reviews.apache.org> In-Reply-To: <20150528114548.8660.77258@reviews.apache.org> Reply-To: "Marco Massenzio" X-ReviewRequest-Repository: mesos --===============5636066992250361774== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On May 28, 2015, 11:45 a.m., Benjamin Hindman wrote: > > 3rdparty/libprocess/3rdparty/stout/tests/flags_tests.cpp, line 517 > > > > > > This looks like a duplicated test with the 'Usage' test above? great catch! modified to test with a derived class that alters the program name not to be picked from argv[0] - Marco ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34193/#review85537 ----------------------------------------------------------- On May 26, 2015, 8:47 p.m., Marco Massenzio wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34193/ > ----------------------------------------------------------- > > (Updated May 26, 2015, 8:47 p.m.) > > > Review request for mesos, Benjamin Hindman and Joris Van Remoortere. > > > Bugs: MESOS-2711 > https://issues.apache.org/jira/browse/MESOS-2711 > > > Repository: mesos > > > Description > ------- > > Jira: MESOS-2711 > > Every program that uses stout's `FlagsBase` ends up > re-implementing the `printUsage()` function, and adding > a `bool help` (and associated --help flag); this functionality > has now been refactored in the base class and is available everywhere. > > This change attempts to be backward-compatible, so it > does not alter the behavior of the program when --help is > invoked (by, eg, automatically printing usage and exiting) > but leaves up to the caller to check for `flags.help` and then > decide what action to take. > > There is now a default behavior for the "leader" ("Usage: [options]") > but the client API allows to modify that too. > > Note - anywhere I found the use of the `--help` flag the behavior was the same: > print usage and exit (see also https://reviews.apache.org/r/34195). > > > Diffs > ----- > > 3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp fb383b463a99924483634eebf22bf34de318f920 > 3rdparty/libprocess/3rdparty/stout/tests/flags_tests.cpp 00281195b53d2597bdb46e3fe6cd9d46a5e9b1f1 > > Diff: https://reviews.apache.org/r/34193/diff/ > > > Testing > ------- > > make check > > **NOTE** this change by itself breaks the build, because the --help is redefined everywhere (16 places, as of last count): CL 34195 fixes that and makes all build/tests pass. > > > Thanks, > > Marco Massenzio > > --===============5636066992250361774==--