def _process_long_opt(option_parser, rargs, values, dests):
 arg = rargs.pop(0)
 if ('=' in arg):
  (opt, next_arg) = arg.split('=', 1)
  rargs.insert(0, next_arg)
 else:
  opt = arg
 opt = option_parser._match_long_opt(opt)
 option = option_parser._long_opt[opt]
 rargs_before_processing = [x for x in rargs]
 if option.takes_value():
  nargs = option.nargs
  if (nargs == 1):
   value = rargs.pop(0)
  else:
   value = tuple(rargs[0:nargs])
   del rargs[0:nargs]
 else:
  value = None
 option.process(opt, value, values, option_parser)
 if ((dests is None) or (option.dest in dests)):
  length_difference = (len(rargs_before_processing) - len(rargs))
  for item in ([opt] + rargs_before_processing[:length_difference]):
   (yield (option.dest, item))

def _process_long_opt ( option_parser , rargs , values , dests ) : arg = rargs . pop ( 0 ) if ( '=' in arg ) : ( opt , next_arg ) = arg . split ( '=' , 1 ) rargs . insert ( 0 , next_arg ) else : opt = arg opt = option_parser . _match_long_opt ( opt ) option = option_parser . _long_opt [ opt ] rargs_before_processing = [ x for x in rargs ] if option . takes_value ( ) : nargs = option . nargs if ( nargs == 1 ) : value = rargs . pop ( 0 ) else : value = tuple ( rargs [ 0 : nargs ] ) del rargs [ 0 : nargs ] else : value = None option . process ( opt , value , values , option_parser ) if ( ( dests is None ) or ( option . dest in dests ) ) : length_difference = ( len ( rargs_before_processing ) - len ( rargs ) ) for item in ( [ opt ] + rargs_before_processing [ : length_difference ] ) : ( yield ( option . dest , item ) )
mimic function of the same name in optionparser .