#NEWLINE# def parse_args( mode = True , name = None ) : #NEWLINE# #INDENT# if ( not name ) : #NEWLINE# #INDENT# name = 'burp-ui' #NEWLINE# #UNINDENT# parser = ArgumentParser ( prog = name ) #NEWLINE# parser . add_argument ( '-v' , '--verbose' , dest = 'log' , help = 'increase output verbosity (e.g., -vv is more verbose than -v)' , action = 'count' ) #NEWLINE# parser . add_argument ( '-d' , '--debug' , dest = 'debug' , help = 'enable debug mode' , action = 'store_true' ) #NEWLINE# parser . add_argument ( '-V' , '--version' , dest = 'version' , help = 'print version and exit' , action = 'store_true' ) #NEWLINE# parser . add_argument ( '-c' , '--config' , dest = 'config' , help = 'configuration file' , metavar = '<CONFIG>' ) #NEWLINE# parser . add_argument ( '-l' , '--logfile' , dest = 'logfile' , help = 'output logs in defined file' , metavar = '<FILE>' ) #NEWLINE# if mode : #NEWLINE# #INDENT# parser . add_argument ( '-m' , '--mode' , dest = 'mode' , help = 'application mode (server or agent)' , metavar = '<agent|server>' ) #NEWLINE# #UNINDENT# options = parser . parse_args ( ) #NEWLINE# if options . version : #NEWLINE# #INDENT# from burpui import __title__ , __version__ , __release__ #NEWLINE# ver = '{}: v{}' . format ( ( name or __title__ ) , __version__ ) #NEWLINE# if options . log : #NEWLINE# #INDENT# ver = '{} ({})' . format ( ver , __release__ ) #NEWLINE# #UNINDENT# print ( ver ) #NEWLINE# sys . exit ( 0 ) #NEWLINE# #UNINDENT# return options