diff --git a/cmd/syft/cli/cli.go b/cmd/syft/cli/cli.go index 49912d887..9372ce775 100644 --- a/cmd/syft/cli/cli.go +++ b/cmd/syft/cli/cli.go @@ -10,6 +10,7 @@ import ( "github.com/anchore/clio" "github.com/anchore/syft/cmd/syft/internal" "github.com/anchore/syft/cmd/syft/internal/commands" + constants "github.com/anchore/syft/internal" ) // Application constructs the `syft packages` command and aliases the root command to `syft packages`. @@ -47,7 +48,7 @@ func create(id clio.Identification, out io.Writer) (clio.Application, *cobra.Com commands.Cataloger(app), commands.Attest(app), commands.Convert(app), - clio.VersionCommand(id), + clio.VersionCommand(id, schemaVersion), clio.ConfigCommand(app, nil), cranecmd.NewCmdAuthLogin(id.Name), // syft login uses the same command as crane ) @@ -59,3 +60,7 @@ func create(id clio.Identification, out io.Writer) (clio.Application, *cobra.Com return app, rootCmd } + +func schemaVersion() (string, any) { + return "SchemaVersion", constants.JSONSchemaVersion +}