11import argparse
22import os
33from pathlib import Path
4- from metacheck .run_somef import run_somef_batch
4+ from metacheck .run_somef import run_somef_batch , run_somef_single
55from metacheck .run_analyzer import run_analysis
66
77
@@ -11,7 +11,7 @@ def cli():
1111 "--input" ,
1212 nargs = "+" ,
1313 required = True ,
14- help = "One or more JSON files containing repositories (e.g., GitHub, GitLab) OR existing SoMEF output files when using --skip-somef."
14+ help = "One or more: GitHub/GitLab URLs, JSON files containing repositories, OR existing SoMEF output files when using --skip-somef."
1515 )
1616 parser .add_argument (
1717 "--skip-somef" ,
@@ -58,17 +58,21 @@ def cli():
5858 threshold = args .threshold
5959 somef_output_dir = os .path .join (os .getcwd (), "somef_outputs" )
6060
61- print (f"Detected { len (args .input )} input files:" )
62- for json_path in args .input :
63- if not os .path .exists (json_path ):
64- print (f"Skipping missing file: { json_path } " )
65- continue
66- print (f"Processing repositories from { json_path } " )
67- run_somef_batch (json_path , somef_output_dir , threshold )
61+ print (f"Detected { len (args .input )} input(s):" )
62+
63+ for input_item in args .input :
64+ if input_item .startswith ("http://" ) or input_item .startswith ("https://" ):
65+ print (f"Processing repository URL: { input_item } " )
66+ run_somef_single (input_item , somef_output_dir , threshold )
67+ elif os .path .exists (input_item ):
68+ print (f"Processing repositories from file: { input_item } " )
69+ run_somef_batch (input_item , somef_output_dir , threshold )
70+ else :
71+ print (f"Warning: Skipping invalid input (not a URL or existing file): { input_item } " )
6872
73+ print (f"\n Running analysis on outputs in { somef_output_dir } ..." )
6974 run_analysis (somef_output_dir , args .pitfalls_output , args .analysis_output )
7075
7176
7277if __name__ == "__main__" :
73- print ("!!!THIS IS THE CORRECT TEST VERSION (MSR26) FIXING ONLY W003!!!" )
7478 cli ()
0 commit comments