summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-20 02:49:07 +0300
committerSimon Glass <sjg@chromium.org>2023-07-24 18:34:11 +0300
commit17a75b9100745361ca3e093a352f136438390686 (patch)
tree7b644b9c2874f83f84712944042bae6d11fa73cf /tools
parent37edf5fc0334034b2358e0d7a13fb5e20cc08b22 (diff)
downloadu-boot-17a75b9100745361ca3e093a352f136438390686.tar.xz
buildman: Split parser creation in two
Split this into two functions to avoid a warning about too many statements. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/buildman/cmdline.py44
1 files changed, 33 insertions, 11 deletions
diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py
index a5febe9da3..e218c8ffae 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')