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

Allow specific versions of formats to be specified #1543

Merged
merged 7 commits into from
Feb 7, 2023

Conversation

kzantow
Copy link
Contributor

@kzantow kzantow commented Feb 6, 2023

This PR adds support for including a version number along with formats, for example: spdx@2.1 or syft@6.

Fixes #1519

Comment on lines -33 to +34
cmd.Flags().StringArrayVarP(&o.Output, "output", "o", FormatAliases(table.ID),
fmt.Sprintf("report output format, options=%v", FormatAliases(syft.FormatIDs()...)))
cmd.Flags().StringArrayVarP(&o.Output, "output", "o", []string{string(table.ID)},
fmt.Sprintf("report output format, options=%v", formats.AllIDs()))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lingering question: should this function (FormatAliases) still exist to customize the format output to the client?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as the cli package has all existing cases covered I think it's alright to remove this

Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow requested a review from a team February 7, 2023 14:32
syft/formats.go Outdated Show resolved Hide resolved
Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow linked an issue Feb 7, 2023 that may be closed by this pull request
syft/sbom/format.go Outdated Show resolved Hide resolved
Signed-off-by: Keith Zantow <kzantow@gmail.com>
syft/sbom/format.go Outdated Show resolved Hide resolved
Copy link
Contributor

@wagoodman wagoodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice addition 🙌

Signed-off-by: Keith Zantow <kzantow@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export specific format versions (SPDX)
2 participants