1515
1616
1717def set_args (mode , path , dep_argument , output , format , link , db_url , timer ,
18- raw , core , no_correction , correct_fpath , ui , setting , exclude_path ):
18+ raw , core , no_correction , correct_fpath , ui , setting , exclude_path ,
19+ recursive_dep ):
1920
2021 selected_source_scanner = "all"
2122 source_write_json_file = False
@@ -30,7 +31,7 @@ def set_args(mode, path, dep_argument, output, format, link, db_url, timer,
3031 s_mode , s_path , s_dep_argument , s_output , s_format , s_link , s_db_url , s_timer , s_raw , s_core , \
3132 s_no_correction , s_correct_fpath , s_ui , s_exclude_path , \
3233 s_selected_source_scanner , s_source_write_json_file , s_source_print_matched_text , \
33- s_source_time_out , s_binary_simple = parse_setting_json (data )
34+ s_source_time_out , s_binary_simple , s_recursive_dep = parse_setting_json (data )
3435
3536 # direct cli arguments have higher priority than setting file
3637 mode = mode or s_mode
@@ -47,6 +48,7 @@ def set_args(mode, path, dep_argument, output, format, link, db_url, timer,
4748 correct_fpath = correct_fpath or s_correct_fpath
4849 ui = ui or s_ui
4950 exclude_path = exclude_path or s_exclude_path
51+ recursive_dep = recursive_dep or s_recursive_dep
5052
5153 # These options are only set from the setting file, not from CLI arguments
5254 selected_source_scanner = s_selected_source_scanner or selected_source_scanner
@@ -60,7 +62,7 @@ def set_args(mode, path, dep_argument, output, format, link, db_url, timer,
6062 return mode , path , dep_argument , output , format , link , db_url , timer , \
6163 raw , core , no_correction , correct_fpath , ui , exclude_path , \
6264 selected_source_scanner , source_write_json_file , source_print_matched_text , source_time_out , \
63- binary_simple
65+ binary_simple , recursive_dep
6466
6567
6668def main ():
@@ -79,7 +81,7 @@ def main():
7981 type = str , dest = 'format' ,nargs = '*' , default = [])
8082 parser .add_argument ('--output' , '-o' , help = 'Output directory or file' ,
8183 type = str , dest = 'output' , default = "" )
82- parser .add_argument ('--dependency' , '-d' , help = 'Dependency arguments' ,
84+ parser .add_argument ('--dependency' , '-d' , help = 'Dependency arguments (e.g. -d "-m pip" ) ' ,
8385 type = str , dest = 'dep_argument' , default = "" )
8486 parser .add_argument ('--url' , '-u' , help = "DB Url" ,
8587 type = str , dest = 'db_url' , default = "" )
@@ -105,6 +107,8 @@ def main():
105107 type = str , required = False , default = '' )
106108 parser .add_argument ('--ui' , help = 'Generate UI mode result file' ,
107109 action = 'store_true' , required = False , default = False )
110+ parser .add_argument ('--recursive_dep' , '-rd' , help = 'Recursively analyze dependencies' ,
111+ action = 'store_true' , dest = 'recursive_dep' , default = False )
108112
109113 try :
110114 args = parser .parse_args ()
@@ -118,16 +122,16 @@ def main():
118122 else :
119123 mode , path , dep_argument , output , format , link , db_url , timer , raw , core , no_correction , correct_fpath , \
120124 ui , exclude_path , selected_source_scanner , source_write_json_file , source_print_matched_text , \
121- source_time_out , binary_simple , = set_args (
125+ source_time_out , binary_simple , recursive_dep = set_args (
122126 args .mode , args .path , args .dep_argument , args .output ,
123127 args .format , args .link , args .db_url , args .timer , args .raw ,
124128 args .core , args .no_correction , args .correct_fpath , args .ui ,
125- args .setting , args .exclude_path )
129+ args .setting , args .exclude_path , args . recursive_dep )
126130
127131 run_main (mode , path , dep_argument , output , format , link , db_url , timer ,
128132 raw , core , not no_correction , correct_fpath , ui , exclude_path ,
129133 selected_source_scanner , source_write_json_file , source_print_matched_text ,
130- source_time_out , binary_simple )
134+ source_time_out , binary_simple , recursive_dep )
131135
132136
133137if __name__ == "__main__" :
0 commit comments