#NEWLINE# def main( ) : #NEWLINE# #INDENT# from . api import convert , Config #NEWLINE# extensions = ( 'xlsx' , ) #NEWLINE# parser = argparse . ArgumentParser ( description = 'OpenVAS to Excel converter' ) #NEWLINE# parser . add_argument ( '-i' , '--openvas-file' , nargs = '*' , dest = 'openvas_files' , help = 'input openvas XML file' , required = True ) #NEWLINE# parser . add_argument ( '-o' , '--output-file' , dest = 'output_file' , help = 'output .xlsx file, with extension' , required = True ) #NEWLINE# parser . add_argument ( '--template' , dest = 'template' , help = 'template to use' , default = None ) #NEWLINE# parser . add_argument ( '--lang' , dest = 'lang' , help = 'language to use' , default = 'es' ) #NEWLINE# parser . add_argument ( '--excluded-hosts' , dest = 'excluded_hosts' , help = 'path to file with hosts to exclude' , default = None ) #NEWLINE# parser . add_argument ( '--scope-hosts' , dest = 'scope_hosts' , help = 'path to file with scope hosts' , default = None ) #NEWLINE# args = parser . parse_args ( ) #NEWLINE# if ( args . output_file . split ( '.' ) [ ( - 1 ) ] not in extensions ) : #NEWLINE# #INDENT# print ( ( '\n\t[!] Invalid output file extension. Valid extensions are: %s\n' % ', ' . join ( extensions ) ) ) #NEWLINE# exit ( 1 ) #NEWLINE# #UNINDENT# config = Config ( args . openvas_files , args . output_file , args . template , parser . lang , args . excluded_hosts , args . scope_hosts ) #NEWLINE# convert ( config )