diff options
author | Simon Glass <sjg@chromium.org> | 2023-02-22 12:14:49 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-03-08 11:40:49 -0800 |
commit | fe7e9245c53e254526d3bbd6296d658596f41b48 (patch) | |
tree | 3cb3fbeec2d4b0a0e0735a9ccd5e35725df9a006 /tools/binman/cmdline.py | |
parent | 932e40d0b52242454be9a7773bd2323e12358b92 (diff) |
binman: Make the tooldir configurable
Add a command-line argument for setting the tooldir, so that the default
can be overridden. Add this directory to the toolpath automatically.
Create the directory if it does not already exist.
Put the default in the argument parser instead of the class, so that it
is more obvious.
Update a few tests that expect the utility name to be provided without
any path (e.g. 'futility'), so they can accept a path, e.g.
/path/to/futility
Update the documentation and add a few tests.
Improve the help for --toolpath while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/cmdline.py')
-rw-r--r-- | tools/binman/cmdline.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py index 986d6f1a315..4eed3073dce 100644 --- a/tools/binman/cmdline.py +++ b/tools/binman/cmdline.py @@ -7,6 +7,7 @@ import argparse from argparse import ArgumentParser +import os from binman import state def make_extract_parser(subparsers): @@ -80,8 +81,11 @@ controlled by a description in the board device tree.''' help='Enabling debugging (provides a full traceback on error)') parser.add_argument('-H', '--full-help', action='store_true', default=False, help='Display the README file') + parser.add_argument('--tooldir', type=str, + default=os.path.join(os.getenv('HOME'), '.binman-tools'), + help='Set the directory to store tools') parser.add_argument('--toolpath', type=str, action='append', - help='Add a path to the directories containing tools') + help='Add a path to the list of directories containing tools') parser.add_argument('-T', '--threads', type=int, default=None, help='Number of threads to use (0=single-thread)') parser.add_argument('--test-section-timeout', action='store_true', |