How to specify file name if --flag is depreciated?

I ran this command:

syft e06d2a3720ac --output syft-json --file sbom.json

but I get the warning:

Flag --file has been deprecated, use: output

but I am using output and if I try to attach a .json file extension like:

syft e06d2a3720ac --output syft-json.json

I get the error:

1 error occurred:
        * unsupported output format "syft-json.json", supported formats are: 
Available formats:
   - cyclonedx-json @ 1.2, 1.3, 1.4, 1.5, 1.6
   - cyclonedx-xml @ 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
   - github-json
   - spdx-json @ 2.2, 2.3
   - spdx-tag-value @ 2.1, 2.2, 2.3
   - syft-json
   - syft-table
   - syft-text

So, how do I use --output to create a file that I can then pass into grype?

1 Like

Hi @digitalghost-dev, thanks for the question!

The --output flag can take a <format>=<path> as its value.

So you can write:

syft --output syft-json=syft.json alpine:latest

for example.

I can see how the deprecation message confusing - I’ll see if I can get some clearer wording into that deprecation message.

@digitalghost-dev I hope this PR will make it more clear how to use --output instead of --file: docs: clearer deprecation message for --file by willmurphyscode · Pull Request #3310 · anchore/syft · GitHub

Thanks for the feedback!

2 Likes

Great, thank you! Thanks for the PR as well :smiley:

1 Like