Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve --output CLI help and README and deprecate --file #1512

Open
tgerla opened this issue Sep 21, 2023 · 2 comments
Open

Improve --output CLI help and README and deprecate --file #1512

tgerla opened this issue Sep 21, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@tgerla
Copy link
Contributor

tgerla commented Sep 21, 2023

This is basically a copy of syft#2165, but for Grype.

Based on the discussion in anchore/syft#1062, we want to improve the CLI help text for the --output parameter, and deprecate the --file parameter. The --output help text currently looks like:

-o, --output stringArray report output formatter, formats=[json table cyclonedx cyclonedx-json sarif template], deprecated formats=[embedded-cyclonedx-vex-json embedded-cyclonedx-vex-xml]

...and it's not clear from that help text that you can do:

-o json=out.json -o table=table.txt

This means that the --file parameter is kind of redundant and confusing, so we should deprecate that option.

We should also update the Grype README to explain the multiple output functionality, like Syft.

@tgerla tgerla added the enhancement New feature or request label Sep 21, 2023
@josephlim75
Copy link

Would like to know how can I achieve multiple template output ? For example, I would like to generate the following output for a single command :-

  1. I want grype to be able to display on stdout
  2. I want grype to be able to generate xml (junit) and html report at the same time while also display on stdout
grype <image> --only-fixed --fail-on high -o template=/report.html -t=/usr/local/share/grype/templates/grype-html.tpl -o template=/report.xml -t=/usr/local/share/grype/templates/grype-junit.tpl

The above command doesn't work. It created 2 report output but just using the last template which is junit

@willmurphyscode
Copy link
Contributor

Hi @josephlim75 - I think your comment will be easier to track if it's in its own issue. I've opened #1531 as a feature request to request specifying multiple templates. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants