From d9d0d69c4d9ffabe58b87416492fcab159cf3911 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Fri, 22 Apr 2022 01:51:34 +0900 Subject: [PATCH] build_image: Support common args Even though build_image uses logger but there was no way to configure it and even -v (verbose) didn't work. common.ParseOptions() parses common arguments (e.g. -v -h --logfile). Bug: n/a Test: m Test: build_image -v ... should print logs Change-Id: I45a61ada9c6a5a616f05d3214e185d08b0f1c152 --- tools/releasetools/build_image.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py index 9049622efb..7fdf4ba61e 100755 --- a/tools/releasetools/build_image.py +++ b/tools/releasetools/build_image.py @@ -814,16 +814,18 @@ def GlobalDictFromImageProp(image_prop, mount_point): def main(argv): - if len(argv) != 4: + args = common.ParseOptions(argv, __doc__) + + if len(args) != 4: print(__doc__) sys.exit(1) common.InitLogging() - in_dir = argv[0] - glob_dict_file = argv[1] - out_file = argv[2] - target_out = argv[3] + in_dir = args[0] + glob_dict_file = args[1] + out_file = args[2] + target_out = args[3] glob_dict = LoadGlobalDict(glob_dict_file) if "mount_point" in glob_dict: