diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-03-13 13:21:51 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-03-14 10:32:17 +0100 |
commit | 642f991b707672af4530ac802e0be67022cd004d (patch) | |
tree | 0928e34b0c9846a167ba8248f6d43b47672234a8 /tools | |
parent | tools/elf2efi: align columns in tables, unify formatting (diff) | |
download | systemd-642f991b707672af4530ac802e0be67022cd004d.tar.xz systemd-642f991b707672af4530ac802e0be67022cd004d.zip |
tools/elf2efi: split out function to create parser
main() is supposed to be lean and mean.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/elf2efi.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/elf2efi.py b/tools/elf2efi.py index a515d1de4f..759c7ab37f 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()) |