1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

tools/elf2efi: split out function to create parser

main() is supposed to be lean and mean.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2024-03-13 13:21:51 +01:00
parent a0797b4ad7
commit 642f991b70

View File

@ -632,7 +632,7 @@ def elf2efi(args: argparse.Namespace):
write_pe(args.PE, coff, opt, sections) 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 = argparse.ArgumentParser(description="Convert ELF binaries to PE/EFI")
parser.add_argument( parser.add_argument(
"--version-major", "--version-major",
@ -686,7 +686,11 @@ def main():
default="", default="",
help="Copy these sections if found", help="Copy these sections if found",
) )
return parser
def main():
parser = create_parser()
elf2efi(parser.parse_args()) elf2efi(parser.parse_args())