From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BCF32C433EF for ; Thu, 30 Jun 2022 21:30:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E8EA83C97; Thu, 30 Jun 2022 23:30:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GjBoo3x1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3B6FB8440C; Thu, 30 Jun 2022 23:30:47 +0200 (CEST) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8ECE580FC2 for ; Thu, 30 Jun 2022 23:30:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=briannorris@chromium.org Received: by mail-pj1-x1033.google.com with SMTP id g7so714153pjj.2 for ; Thu, 30 Jun 2022 14:30:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NddMp4Ze9pz+e25ulqs69sC3EBkGVAc2wSIbi9XfZdU=; b=GjBoo3x1FpUsCm7eBESKguM8EfIhNGrNEihEt3/SxC8TC0Rygbab1VTlhAFzvlAN0d sy2VC8G/V29/2Oo6m7thS6G4ivym/8tWWJE7iUVpnpleRx6RLY8kOJajShetK8ECqgho r/6wrA7LyLOctCQEzBz6jCGAYYuIyhlzZ1Tqo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NddMp4Ze9pz+e25ulqs69sC3EBkGVAc2wSIbi9XfZdU=; b=1GCTy4KAxA5VjX8PVfuOqYPqwnTaTb6VixpSUFIyDDeAsoyKvQ1aJEhn7H1K7lkfDk CgkPTnjDonJ9OKQx/9dumdjDNYH4gILbO38dbWHOw0mZ+F1w1jKSzVdDHeERra11fqqG Iy7OwBvYnoa64ZS2llIWcL0jm3HnE2PFbjOiOxZ6yggYgge3QdlW8w1Eb2x5fxDE596Q LyKXjE5ALAnpdjklmoDOAw4DArjlEMsmj2Ym+dlz84lkuP7Rcf+1A7uhb13xRmHIBgmY 0SmQDx6wCpo5lroz3jJBWp2qecpf+ixiJP5CV2k7XqoN1MWZ7/EeBGb9gaADBNvFKmgj EdBw== X-Gm-Message-State: AJIora99i4CP3453emnB23mPa9l6JR3GufyKSAB8zPcmRVFFksrYBIZJ UQT+uMxEU58GIA5ph/WQWzxPnA== X-Google-Smtp-Source: AGRyM1unOMU9+MyL/FqWHx/2f4u00Z1u40KGlu8+PdCvo7eYfGQV0bvPbVog8nPQlvLuTfQFDk29aA== X-Received: by 2002:a17:902:768a:b0:16b:997e:e13 with SMTP id m10-20020a170902768a00b0016b997e0e13mr13367692pll.19.1656624642903; Thu, 30 Jun 2022 14:30:42 -0700 (PDT) Received: from google.com ([2620:15c:202:201:1ae5:143d:6ad2:d52a]) by smtp.gmail.com with ESMTPSA id n5-20020a170902d2c500b0015e9f45c1f4sm14082343plc.186.2022.06.30.14.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 14:30:42 -0700 (PDT) Date: Thu, 30 Jun 2022 14:30:40 -0700 From: Brian Norris To: Douglas Anderson Cc: sjg@chromium.org, amstan@chromium.org, mka@chromium.org, u-boot@lists.denx.de Subject: Re: [PATCH 4/6] patman: Make most bool arguments BooleanOptionalAction Message-ID: References: <20220630210809.2261698-1-dianders@chromium.org> <20220630140742.4.I6cb1a37e190dd759acc478beb2b0e0dc8e483923@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220630140742.4.I6cb1a37e190dd759acc478beb2b0e0dc8e483923@changeid> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Thu, Jun 30, 2022 at 02:08:07PM -0700, Doug Anderson wrote: > For boolean arguments it's convenient to be able to specify both the > argument and its opposite on the command line. This is especially > convenient because you can change the default via the settings file > and being able express the opposite can be the only way to override > things. > > Luckily python handles this well--we just need to specify things with > BooleanOptionalAction. We'll do that for all options except > "full-help" (where it feels silly). This uglifies the help text a > little bit but does give maximum flexibility. > > Signed-off-by: Douglas Anderson > --- > > tools/patman/main.py | 52 +++++++++++++++++++++++--------------------- > 1 file changed, 27 insertions(+), 25 deletions(-) > > diff --git a/tools/patman/main.py b/tools/patman/main.py > index 336f4e439aa9..9684300c022c 100755 > --- a/tools/patman/main.py > +++ b/tools/patman/main.py > -send.add_argument('-t', '--ignore-bad-tags', action='store_true', > +send.add_argument('-t', '--ignore-bad-tags', action=BooleanOptionalAction, > default=False, > help='Ignore bad tags / aliases (default=warn)') I know you mentioned --help ugliness, but this one ends up looking like: (default=warn) (default: False) Perhaps we should drop the baked-in "(default=warn)" text? Otherwise: Reviewed-by: Brian Norris Tested-by: Brian Norris