#NEWLINE# @ utils . module_required #NEWLINE# def command_show( self , * args , **kwargs ) : #NEWLINE# #INDENT# ( info , options ) = ( 'info' , 'options' ) #NEWLINE# sub_command = args [ 0 ] #NEWLINE# if ( sub_command == info ) : #NEWLINE# #INDENT# utils . pprint_dict_in_order ( self . module_metadata , ( 'name' , 'description' , 'targets' , 'authors' , 'references' ) ) #NEWLINE# utils . print_info ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( sub_command == options ) : #NEWLINE# #INDENT# target_opts = { 'port' , 'target' } #NEWLINE# module_opts = ( set ( self . current_module . options ) - target_opts ) #NEWLINE# headers = ( 'Name' , 'Current settings' , 'Description' ) #NEWLINE# utils . print_info ( '\nTarget options:' ) #NEWLINE# utils . print_table ( headers , * self . get_opts ( * target_opts ) ) #NEWLINE# if module_opts : #NEWLINE# #INDENT# utils . print_info ( '\nModule options:' ) #NEWLINE# utils . print_table ( headers , * self . get_opts ( * module_opts ) ) #NEWLINE# #UNINDENT# utils . print_info ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( "Unknown command 'show {}'. You want to 'show {}' or 'show {}'?" . format ( sub_command , info , options ) )