Skip to contentSkip to conversation

utils/generate-cyclonedx: improve help text

Buildroot Rapha��l M��lotte via buildroot 1 participant 1 message Oct 16

lore
Share & tools
lore
#0 lore raw

commit: https://gitlab.com/buildroot.org/buildroot/-/commit/ca734db97298028d5fc9b173c655c564c28ba85a
branch: https://gitlab.com/buildroot.org/buildroot/-/tree/2026.08.x

The argparse has a set of arguments you can pass to the ArgumentParser object to improve the looks of the help message.

The example usage used to be defined in the "description" but a "usage" field exists [1].

Also link to the documentation in the epilog [2].

[1] https://docs.python.org/3/library/argparse.html#usage
[2] https://docs.python.org/3/library/argparse.html#epilog

(cherry picked from commit c13eabf18f6541bb264aa1b041ee56206c95c810)
---
 utils/generate-cyclonedx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
utils/generate-cyclonedx +3 -3
index c292ef7840..9d3baa23f1 100755
@@ -529,9 +529,9 @@ def br2_root_deps(show_info_dict, virtual=False) -> list:
 
 def main():
     parser = argparse.ArgumentParser(
-        description='''Create a CycloneDX SBoM for the Buildroot configuration.
-            Example usage: make show-info | utils/generate-cyclonedx > sbom.json
-        ''',
+        description="Create a CycloneDX SBoM for the Buildroot configuration.",
+        usage="make show-info | utils/%(prog)s > sbom.json",
+        epilog="For more information see https://buildroot.org/downloads/manual/manual.html#_generating_cyclonedx_sbom",
         formatter_class=argparse.ArgumentDefaultsHelpFormatter
     )
     parser.add_argument("-i", "--in-file", nargs="?", type=argparse.FileType("r"),

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot