utils/generate-cyclonedx: improve help text

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

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Thomas Perale
2026-10-11 11:42:13 +02:00
committed by Arnout Vandecappelle
parent 358f226809
commit c13eabf18f

View File

@@ -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"),