]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix --help
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 8 Sep 2023 11:04:12 +0000 (13:04 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Fri, 8 Sep 2023 11:55:50 +0000 (13:55 +0200)
We need to only execute --help once we have the full parser otherwise
it won't show all settings.

mkosi/config.py

index 8f21d49700e2cef86afc5dfcebd42568e49fa4b0..3cc3836f04225cf26e8ac699d9340757032c99eb 100644 (file)
@@ -1688,11 +1688,6 @@ def create_argument_parser(*, settings: bool) -> argparse.ArgumentParser:
         formatter_class=CustomHelpFormatter,
     )
 
-    parser.add_argument(
-        "-h", "--help",
-        action=PagerHelpAction,
-        help=argparse.SUPPRESS,
-    )
     parser.add_argument(
         "--version",
         action="version",
@@ -1795,6 +1790,11 @@ def create_argument_parser(*, settings: bool) -> argparse.ArgumentParser:
         nargs=argparse.REMAINDER,
         help=argparse.SUPPRESS,
     )
+    parser.add_argument(
+        "-h", "--help",
+        action=PagerHelpAction,
+        help=argparse.SUPPRESS,
+    )
 
     last_section = None