@@ -9,6 +9,7 @@ import { createSbom } from '../../service/cdx.svc.ts';
99import {
1010 countComponentsByStatus ,
1111 formatDataPrivacyLink ,
12+ formatReportSaveHint ,
1213 formatScanResults ,
1314 formatWebReportUrl ,
1415} from '../../service/display.svc.ts' ;
@@ -68,6 +69,11 @@ export default class ScanEol extends Command {
6869 default : false ,
6970 description : `Save the trimmed SBOM as ${ filenamePrefix } .sbom-trimmed.json in the scanned directory` ,
7071 } ) ,
72+ hideReportUrl : Flags . boolean ( {
73+ aliases : [ 'hide-report-url' ] ,
74+ default : false ,
75+ description : 'Hide the generated web report URL for this scan' ,
76+ } ) ,
7177 version : Flags . version ( ) ,
7278 } ;
7379
@@ -125,7 +131,8 @@ export default class ScanEol extends Command {
125131 sbom_created : ! flags . file ,
126132 scan_load_time : ( scanEndTime - scanStartTime ) / 1000 ,
127133 scanned_ecosystems : componentCounts . ECOSYSTEMS ,
128- web_report_link : scan . id ? `${ config . eolReportUrl } /${ scan . id } ` : undefined ,
134+ web_report_link : ! flags . hideReportUrl && scan . id ? `${ config . eolReportUrl } /${ scan . id } ` : undefined ,
135+ web_report_hidden : flags . hideReportUrl ,
129136 } ) ) ;
130137
131138 if ( flags . save ) {
@@ -139,7 +146,7 @@ export default class ScanEol extends Command {
139146 }
140147
141148 if ( ! this . jsonEnabled ( ) ) {
142- this . displayResults ( scan ) ;
149+ this . displayResults ( scan , flags . hideReportUrl ) ;
143150 }
144151
145152 return scan ;
@@ -225,17 +232,22 @@ export default class ScanEol extends Command {
225232 }
226233 }
227234
228- private displayResults ( report : EolReport ) : void {
235+ private displayResults ( report : EolReport , hideReportUrl : boolean ) : void {
229236 const lines = formatScanResults ( report ) ;
230237 for ( const line of lines ) {
231238 this . log ( line ) ;
232239 }
233240
234- if ( report . id ) {
241+ if ( ! hideReportUrl && report . id ) {
235242 const lines = formatWebReportUrl ( report . id , config . eolReportUrl ) ;
236243 for ( const line of lines ) {
237244 this . log ( line ) ;
238245 }
246+ } else if ( hideReportUrl ) {
247+ const lines = formatReportSaveHint ( ) ;
248+ for ( const line of lines ) {
249+ this . log ( line ) ;
250+ }
239251 }
240252
241253 const privacyLines = formatDataPrivacyLink ( ) ;
0 commit comments