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:
parent
a0797b4ad7
commit
642f991b70
@ -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())
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user