summaryrefslogtreecommitdiffstats
path: root/src/ukify
diff options
context:
space:
mode:
authorJörg Behrmann <behrmann@physik.fu-berlin.de>2024-10-05 11:53:35 +0200
committerJörg Behrmann <behrmann@physik.fu-berlin.de>2024-10-09 12:11:57 +0200
commit3d2144a214f9dc7e20126f01e16e27098d881a5d (patch)
treea6627168cc17404e90f43b9828d36a9525bf666f /src/ukify
parentukify: Type-annotate ukify (diff)
downloadsystemd-3d2144a214f9dc7e20126f01e16e27098d881a5d.tar.xz
systemd-3d2144a214f9dc7e20126f01e16e27098d881a5d.zip
ukify: Move summary option handling out of finalize_options
This way finalize_options will not call sys.exit by itself.
Diffstat (limited to 'src/ukify')
-rwxr-xr-xsrc/ukify/ukify.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py
index a76ceadf11..a2df3e83e3 100755
--- a/src/ukify/ukify.py
+++ b/src/ukify/ukify.py
@@ -1919,11 +1919,6 @@ def finalize_options(opts: argparse.Namespace) -> None:
# A convenience dictionary to make it easy to look up sections
opts.sections_by_name = {s.name: s for s in opts.sections}
- if opts.summary:
- # TODO: replace pprint() with some fancy formatting.
- pprint.pprint(vars(opts))
- sys.exit()
-
def parse_args(args: Optional[list[str]] = None) -> argparse.Namespace:
opts = create_parser().parse_args(args)
@@ -1934,7 +1929,10 @@ def parse_args(args: Optional[list[str]] = None) -> argparse.Namespace:
def main() -> None:
opts = parse_args()
- if opts.verb == 'build':
+ if opts.summary:
+ # TODO: replace pprint() with some fancy formatting.
+ pprint.pprint(vars(opts))
+ elif opts.verb == 'build':
check_inputs(opts)
make_uki(opts)
elif opts.verb == 'genkey':