#NEWLINE# def match( self , argv , repeat_match ) : #NEWLINE# #INDENT# if ( ( not repeat_match ) and self . value ) : #NEWLINE# #INDENT# logger . debug ( '%s already has a value %s' , self , self . value ) #NEWLINE# return True #NEWLINE# #UNINDENT# current = argv . current ( ) #NEWLINE# if ( current is None ) : #NEWLINE# #INDENT# logger . debug ( 'argv ran out before matching %s' , self ) #NEWLINE# return False #NEWLINE# #UNINDENT# if argv . option_only : #NEWLINE# #INDENT# logger . debug ( 'option only, %s skipped.' , self ) #NEWLINE# return False #NEWLINE# #UNINDENT# skip = 0 #NEWLINE# if ( current == '--' ) : #NEWLINE# #INDENT# argv . check_dash ( ) #NEWLINE# if ( argv . auto_dashes and argv . dashes ) : #NEWLINE# #INDENT# current = argv . current ( 1 ) #NEWLINE# skip = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . debug ( '%s matching %s failed' , self , current ) #NEWLINE# return False #NEWLINE# #UNINDENT# #UNINDENT# if ( ( current not in self . names ) or ( Atom . get_class ( current ) [ 0 ] is Option ) ) : #NEWLINE# #INDENT# logger . debug ( '%s matching %s failed' , self , current ) #NEWLINE# return False #NEWLINE# #UNINDENT# if repeat_match : #NEWLINE# #INDENT# self . value += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . value = True #NEWLINE# #UNINDENT# argv . next ( skip ) #NEWLINE# logger . debug ( '%s matched %s/%s' , self , self . value , argv ) #NEWLINE# return True