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 B9768C001DC for ; Wed, 19 Jul 2023 23:59:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C50386702; Thu, 20 Jul 2023 01:52:41 +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="QL6S+Xii"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 81892867E2; Thu, 20 Jul 2023 01:50:51 +0200 (CEST) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 9A4358606E for ; Thu, 20 Jul 2023 01:50: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=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-78362f574c9so8199539f.3 for ; Wed, 19 Jul 2023 16:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810643; x=1690415443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JbKZ8G3Ff+aDjWtciJdV0BmE7MOoUII+nXtBzKG+2n8=; b=QL6S+XiiGTwVOX9GFPBnRvzJxrc+Jml2Kuxu1kMz9fj0GrlSEygdbT4r5g2HuEUQp7 rM0CS2TMedIP55G9RS9w1kMYc4aeKg/mWaeBXRbc16jGxfVgaaMjTJe3Va+/XSyq0Pis UFPReXptrY1lQ/s7Ye96B5lMyJV2HAP2yhCAE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810643; x=1690415443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JbKZ8G3Ff+aDjWtciJdV0BmE7MOoUII+nXtBzKG+2n8=; b=KTYM4BquUModJx9bDiEn2zHFSv+hygPROlao6I8SSDSFC0TkfgjIgQk2do7HYK2f0v rT/dULndGYhdeDq3ZLSqbOE59t8C75nuGSIrKcpz7bgsFscsw+TuYEG2z/FuC/mpJnES PeOEbbt+uTnA4xEvNSSxil1AqdDiEcp3ZqMGUCsxFjZGi4IiiuM+30LHBVzL+SDH6ChW CJQViumCc2ALmF0UlIeVw6qwoMIklNYqJc2XPZaluLOuuu+28w80G/3kGVzdpAsYMonV wkdr+Avh6tP22QX/7ycsLWvUXhBhGA746+Esn0ImDZkSjow25KlnmJTANDBJ/o0S9Nbx nEbw== X-Gm-Message-State: ABy/qLboEguLihQLe5hac70bKIpNP4xNgX7n0yYJI5WDBWMiDJWY8A9M jCce941npvLW65A1+ZRLk4eaQ6+NvcCP3E4tRoo= X-Google-Smtp-Source: APBJJlEE3GXD+JWBdTGnbeUDGyZTmWYlF8zgPnmbWD0fDuQmKi8SISShwvEK8KX3iK6D1KuYAYy9Rg== X-Received: by 2002:a5e:a90b:0:b0:783:63ac:25cf with SMTP id c11-20020a5ea90b000000b0078363ac25cfmr6804735iod.7.1689810643186; Wed, 19 Jul 2023 16:50:43 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id ed16-20020a056638291000b0042bb1779c18sm1551779jab.151.2023.07.19.16.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:43 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 59/83] buildman: Split parser creation in two Date: Wed, 19 Jul 2023 17:49:07 -0600 Message-ID: <20230719234953.796101-60-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230719234953.796101-1-sjg@chromium.org> References: <20230719234953.796101-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.8 at phobos.denx.de X-Virus-Status: Clean Split this into two functions to avoid a warning about too many statements. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/cmdline.py | 44 +++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py index a5febe9da3e9..e218c8ffae76 100644 --- a/tools/buildman/cmdline.py +++ b/tools/buildman/cmdline.py @@ -14,19 +14,14 @@ import pathlib BUILDMAN_DIR = pathlib.Path(__file__).parent HAS_TESTS = os.path.exists(BUILDMAN_DIR / "test.py") -def parse_args(): - """Parse command line arguments from sys.argv[] - - Returns: - tuple containing: - options: command line options - args: command lin arguments - """ - epilog = """ [list of target/arch/cpu/board/vendor/soc to build] +def add_upto_m(parser): + """Add arguments up to 'M' - Build U-Boot for all commits in a branch. Use -n to do a dry run""" + Args: + parser (ArgumentParser): Parse to add to - parser = argparse.ArgumentParser(epilog=epilog) + This is split out to avoid having too many statements in one function + """ parser.add_argument('-a', '--adjust-cfg', type=str, action='append', help='Adjust the Kconfig settings in .config before building') parser.add_argument('-A', '--print-prefix', action='store_true', @@ -107,6 +102,16 @@ def parse_args(): parser.add_argument('-N', '--no-subdirs', action='store_true', dest='no_subdirs', default=False, help="Don't create subdirectories when building current source for a single board") + + +def add_after_m(parser): + """Add arguments after 'M' + + Args: + parser (ArgumentParser): Parse to add to + + This is split out to avoid having too many statements in one function + """ parser.add_argument('-o', '--output-dir', type=str, dest='output_dir', help='Directory where all builds happen and buildman has its workspace (default is ../)') parser.add_argument('-O', '--override-toolchain', type=str, @@ -156,6 +161,23 @@ def parse_args(): parser.add_argument('-Y', '--filter-migration-warnings', action='store_true', default=False, help='Filter out migration warnings from output') + + +def parse_args(): + """Parse command line arguments from sys.argv[] + + Returns: + tuple containing: + options: command line options + args: command lin arguments + """ + epilog = """ [list of target/arch/cpu/board/vendor/soc to build] + + Build U-Boot for all commits in a branch. Use -n to do a dry run""" + + parser = argparse.ArgumentParser(epilog=epilog) + add_upto_m(parser) + add_after_m(parser) parser.add_argument('terms', type=str, nargs='*', help='Board / SoC names to build') -- 2.41.0.487.g6d72f3e995-goog