summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-13 13:21:51 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-14 10:32:17 +0100
commit642f991b707672af4530ac802e0be67022cd004d (patch)
tree0928e34b0c9846a167ba8248f6d43b47672234a8 /tools
parenttools/elf2efi: align columns in tables, unify formatting (diff)
downloadsystemd-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-xtools/elf2efi.py6
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())