#NEWLINE# def add_option( self , parser ) : #NEWLINE# #INDENT# if ( not self . cli ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# args = tuple ( self . cli ) #NEWLINE# help_txt = ( '%s [%s]' % ( self . short , self . default ) ) #NEWLINE# help_txt = help_txt . replace ( '%' , '%%' ) #NEWLINE# kwargs = { #NEWLINE# #INDENT# 'dest' : self . name , #NEWLINE# 'action' : ( self . action or 'store' ) , #NEWLINE# 'type' : ( self . type or str ) , #NEWLINE# 'default' : None , #NEWLINE# 'help' : help_txt , #NEWLINE# #UNINDENT# } #NEWLINE# if ( self . meta is not None ) : #NEWLINE# #INDENT# kwargs [ 'metavar' ] = self . meta #NEWLINE# #UNINDENT# if ( kwargs [ 'action' ] != 'store' ) : #NEWLINE# #INDENT# kwargs . pop ( 'type' ) #NEWLINE# #UNINDENT# if ( self . nargs is not None ) : #NEWLINE# #INDENT# kwargs [ 'nargs' ] = self . nargs #NEWLINE# #UNINDENT# if ( self . const is not None ) : #NEWLINE# #INDENT# kwargs [ 'const' ] = self . const #NEWLINE# #UNINDENT# parser . add_argument ( * args , ** kwargs )