interlynk-io / sbomex

Find & pull public SBOMs
https://sbombenchmark.dev/
Other
16 stars 2 forks source link

Invalid spec/format values have usability issues #15

Closed surendrapathak closed 1 year ago

surendrapathak commented 1 year ago

The error message is always "invalid spec." It should be called out specifically.

Error messages:

  1. spec options are spdx or cdx
  2. format options are xml , json or tv (for tag-value)
Screenshot 2023-03-09 at 10 40 18 PM

Example of better error handling below -

  1. Shows the error string
  2. Prints help message
sbomqs score ~/Downloads/09-07-2022.csv --reportFormat basic2
Error: report format options are basic or detailed
Usage:
  sbomqs score [flags]

Flags:
      --category string       scoring category
      --dirpath string        sbom dir path
      --filepath string       sbom file path
  -h, --help                  help for score
      --reportFormat string   reporting format basic/detailed/json