@@ -42,6 +42,7 @@ import (
4242 "github.com/jfrog/jfrog-cli-security/commands/sast_server"
4343 "github.com/jfrog/jfrog-cli-security/commands/source_mcp"
4444 "github.com/jfrog/jfrog-cli-security/sca/bom/indexer"
45+ "github.com/jfrog/jfrog-cli-security/utils/formats"
4546 "github.com/jfrog/jfrog-cli-security/utils/xray"
4647
4748 "github.com/jfrog/jfrog-cli-security/commands/audit"
@@ -56,8 +57,10 @@ import (
5657 "github.com/jfrog/jfrog-cli-security/utils/xsc"
5758)
5859
59- const DockerScanCmdHiddenName = "dockerscan"
60- const SkipCurationAfterFailureEnv = "JFROG_CLI_SKIP_CURATION_AFTER_FAILURE"
60+ const (
61+ DockerScanCmdHiddenName = "dockerscan"
62+ SkipCurationAfterFailureEnv = "JFROG_CLI_SKIP_CURATION_AFTER_FAILURE"
63+ )
6164
6265func getAuditAndScansCommands () []components.Command {
6366 return []components.Command {
@@ -71,13 +74,14 @@ func getAuditAndScansCommands() []components.Command {
7174 Action : ScanCmd ,
7275 },
7376 {
74- Name : "sbom-enrich" ,
75- Aliases : []string {"se" },
76- Flags : flags .GetCommandFlags (flags .Enrich ),
77- Description : enrichDocs .GetDescription (),
78- Arguments : enrichDocs .GetArguments (),
79- Category : securityCategory ,
80- Action : EnrichCmd ,
77+ Name : "sbom-enrich" ,
78+ Aliases : []string {"se" },
79+ Flags : flags .GetCommandFlags (flags .Enrich ),
80+ Description : enrichDocs .GetDescription (),
81+ Arguments : enrichDocs .GetArguments (),
82+ Category : securityCategory ,
83+ SupportedFormats : []outputFormat.OutputFormat {outputFormat .Json , outputFormat .Table },
84+ Action : EnrichCmd ,
8185 },
8286 {
8387 Name : "malicious-scan" ,
@@ -211,7 +215,6 @@ func getAuditAndScansCommands() []components.Command {
211215}
212216
213217func SourceMcpCmd (c * components.Context ) error {
214-
215218 serverDetails , err := CreateServerDetailsFromFlags (c )
216219 if err != nil {
217220 return err
@@ -266,11 +269,16 @@ func EnrichCmd(c *components.Context) error {
266269 if err != nil {
267270 return err
268271 }
269- EnrichCmd := enrich .NewEnrichCommand ().
272+ format , err := c .GetOutputFormat ()
273+ if err != nil {
274+ return err
275+ }
276+ enrichCmd := enrich .NewEnrichCommand ().
270277 SetServerDetails (serverDetails ).
271278 SetThreads (threads ).
272- SetSpec (specFile )
273- return commandsCommon .Exec (EnrichCmd )
279+ SetSpec (specFile ).
280+ SetOutputFormat (format )
281+ return commandsCommon .Exec (enrichCmd )
274282}
275283
276284func MaliciousScanCmd (c * components.Context ) error {
@@ -281,7 +289,7 @@ func MaliciousScanCmd(c *components.Context) error {
281289 if err = validateConnectionInputs (serverDetails ); err != nil {
282290 return err
283291 }
284- format , err := outputFormat .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
292+ format , err := formats .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
285293 if err != nil {
286294 return err
287295 }
@@ -318,7 +326,7 @@ func ScanCmd(c *components.Context) error {
318326 if err != nil {
319327 return err
320328 }
321- format , err := outputFormat .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
329+ format , err := formats .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
322330 if err != nil {
323331 return err
324332 }
@@ -437,7 +445,7 @@ func BuildScan(c *components.Context) error {
437445 if err != nil {
438446 return err
439447 }
440- format , err := outputFormat .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
448+ format , err := formats .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
441449 if err != nil {
442450 return err
443451 }
@@ -526,7 +534,7 @@ func CreateAuditCmd(c *components.Context) (string, string, *coreConfig.ServerDe
526534 if err != nil {
527535 return "" , "" , nil , nil , err
528536 }
529- format , err := outputFormat .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
537+ format , err := formats .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
530538 if err != nil {
531539 return "" , "" , nil , nil , err
532540 }
@@ -789,7 +797,7 @@ func DockerScan(c *components.Context, image string) error {
789797 if err != nil {
790798 return err
791799 }
792- format , err := outputFormat .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
800+ format , err := formats .GetOutputFormat (c .GetStringFlagValue (flags .OutputFormat ))
793801 if err != nil {
794802 return err
795803 }
0 commit comments