@@ -51,6 +51,7 @@ def main():
5151 scanned_result = []
5252 license_list = []
5353 time_out = 120
54+ core = - 1
5455
5556 parser = argparse .ArgumentParser (description = 'FOSSLight Source' , prog = 'fosslight_source' , add_help = False )
5657 parser .add_argument ('-h' , '--help' , action = 'store_true' , required = False )
@@ -62,6 +63,7 @@ def main():
6263 parser .add_argument ('-f' , '--format' , nargs = 1 , type = str , required = False )
6364 parser .add_argument ('-s' , '--scanner' , nargs = 1 , type = str , required = False , default = 'all' )
6465 parser .add_argument ('-t' , '--timeout' , type = int , required = False , default = 120 )
66+ parser .add_argument ('-c' , '--cores' , type = int , required = False , default = - 1 )
6567
6668 args = parser .parse_args ()
6769
@@ -84,6 +86,7 @@ def main():
8486 selected_scanner = '' .join (args .scanner )
8587
8688 time_out = args .timeout
89+ core = args .cores
8790
8891 timer = TimerThread ()
8992 timer .setDaemon (True )
@@ -103,14 +106,14 @@ def main():
103106 if os .path .isdir (path_to_scan ):
104107 if selected_scanner == 'scancode' :
105108 success , _result_log ["Scan Result" ], scanned_result , license_list = run_scan (path_to_scan , output_file_name ,
106- write_json_file , - 1 , True ,
109+ write_json_file , core , True ,
107110 print_matched_text , format , True ,
108111 time_out )
109112 elif selected_scanner == 'scanoss' :
110113 scanned_result = run_scanoss_py (path_to_scan , output_file_name , format , True , write_json_file )
111114 elif selected_scanner == 'all' or selected_scanner == '' :
112115 success , _result_log ["Scan Result" ], scanned_result , license_list = run_all_scanners (path_to_scan , output_file_name ,
113- write_json_file , - 1 ,
116+ write_json_file , core ,
114117 print_matched_text , format , True ,
115118 time_out )
116119 else :
0 commit comments