From 642f991b707672af4530ac802e0be67022cd004d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 13 Mar 2024 13:21:51 +0100 Subject: [PATCH] tools/elf2efi: split out function to create parser main() is supposed to be lean and mean. --- tools/elf2efi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/elf2efi.py b/tools/elf2efi.py index a515d1de4fd..759c7ab37ff 100755 --- a/tools/elf2efi.py +++ b/tools/elf2efi.py @@ -632,7 +632,7 @@ def elf2efi(args: argparse.Namespace): write_pe(args.PE, coff, opt, sections) -def main(): +def create_parser() -> argparse.ArgumentParser: parser = argparse.ArgumentParser(description="Convert ELF binaries to PE/EFI") parser.add_argument( "--version-major", @@ -686,7 +686,11 @@ def main(): default="", help="Copy these sections if found", ) + return parser + +def main(): + parser = create_parser() elf2efi(parser.parse_args())