@@ -20,6 +20,9 @@ def clear_screen():
2020
2121console = Console ()
2222
23+ ## Now separate the results by data_source
24+ data_sources = ['s3' , 'mysql' , 'redis' , 'firebase' , 'gcs' , 'fs' ]
25+
2326def load_command_module (command ):
2427 try :
2528 module = importlib .import_module (f"hawk_scanner.commands.{ command } " )
@@ -39,24 +42,25 @@ def execute_command(command, args):
3942
4043
4144def main ():
42- ## Now separate the results by data_source
43- data_sources = ['s3' , 'mysql' , 'redis' , 'firebase' , 'gcs' , 'fs' ]
44-
45+ data_sources_option = ['all' ] + data_sources
4546 parser = argparse .ArgumentParser (description = 'CLI Command Executor' )
46- parser .add_argument ('command' , nargs = '?' , choices = data_sources , help = 'Command to execute' )
47+ parser .add_argument ('command' , nargs = '?' , choices = data_sources_option , help = 'Command to execute' )
4748 parser .add_argument ('--json' , help = 'Save output to json file' )
4849 parser .add_argument ('--debug' , action = 'store_true' , help = 'Enable debug mode' )
4950
5051 args , extra_args = parser .parse_known_args ()
5152 results = []
5253 if args .command :
53- for data in execute_command (args .command , extra_args ):
54- results .append (data )
55- else :
56- commands = data_sources
57- for command in commands :
58- for data in execute_command (command , extra_args ):
54+ if args .command == 'all' :
55+ commands = data_sources
56+ for command in commands :
57+ for data in execute_command (command , extra_args ):
58+ results .append (data )
59+ else :
60+ for data in execute_command (args .command , extra_args ):
5961 results .append (data )
62+ else :
63+ system .print_error ("Please provide a command to execute" )
6064
6165 ## GROUP results in grouped_results by datasource by key val
6266 grouped_results = {}
0 commit comments