@@ -56,17 +56,18 @@ def main():
5656 timer = TimerThread ()
5757 timer .setDaemon (True )
5858 timer .start ()
59- success , result_log = run_scan (_path_to_scan , _output_file , _write_json_file , - 1 )
59+ run_scan (_path_to_scan , _output_file , _write_json_file , - 1 , False )
6060
6161
6262def run_scan (path_to_scan , output_file_name = "" ,
63- _write_json_file = False , num_cores = - 1 ):
63+ _write_json_file = False , num_cores = - 1 , return_results = False ):
6464 global logger
6565
6666 success = True
6767 msg = ""
6868 _str_final_result_log = ""
6969 _result_log = {}
70+ result_list = []
7071
7172 _windows = platform .system () == "Windows"
7273 start_time = datetime .now ().strftime ('%Y-%m-%d_%H-%M-%S' )
@@ -128,6 +129,8 @@ def run_scan(path_to_scan, output_file_name="",
128129 success = False
129130 msg = _ERROR_PREFIX + "Check the path to scan. :" + path_to_scan + "\n "
130131
132+ if not return_results :
133+ result_list = []
131134 scan_result_msg = str (success )+ " " + msg
132135 _result_log ["Scan Result" ] = scan_result_msg .strip ()
133136 _result_log ["Output Directory" ] = output_dir
@@ -136,7 +139,7 @@ def run_scan(path_to_scan, output_file_name="",
136139 logger .warn ("\n " + _str_final_result_log )
137140 except Exception as ex :
138141 logger .warn (_ERROR_PREFIX + "Failed to print result log. " + str (ex ))
139- return success , _str_final_result_log
142+ return success , _str_final_result_log , result_list
140143
141144
142145if __name__ == '__main__' :
0 commit comments