def _add_runner_options_for_opt(parser, opt_name, include_deprecated=True):
 conf = _RUNNER_OPTS[opt_name]
 if (conf.get('deprecated') and (not include_deprecated)):
  return
 switches = (conf.get('switches') or [])
 for (args, kwargs) in switches:
  kwargs = dict(kwargs)
  deprecated_aliases = kwargs.pop('deprecated_aliases', None)
  kwargs['dest'] = opt_name
  if kwargs.get('callback'):
   kwargs.setdefault('action', 'callback')
   kwargs.setdefault('nargs', 1)
   kwargs.setdefault('type', 'string')
  if (kwargs.get('action') == 'append'):
   kwargs['default'] = []
  else:
   kwargs['default'] = None
  parser.add_option(*args, **kwargs)
  if (deprecated_aliases and include_deprecated):
   help = ('Deprecated alias%s for %s' % (('es' if (len(deprecated_aliases) > 1) else ''), args[(-1)]))
   parser.add_option(*deprecated_aliases, **combine_dicts(kwargs, dict(help=help)))

def _add_runner_options_for_opt ( parser , opt_name , include_deprecated = True ) : conf = _RUNNER_OPTS [ opt_name ] if ( conf . get ( 'deprecated' ) and ( not include_deprecated ) ) : return switches = ( conf . get ( 'switches' ) or [ ] ) for ( args , kwargs ) in switches : kwargs = dict ( kwargs ) deprecated_aliases = kwargs . pop ( 'deprecated_aliases' , None ) kwargs [ 'dest' ] = opt_name if kwargs . get ( 'callback' ) : kwargs . setdefault ( 'action' , 'callback' ) kwargs . setdefault ( 'nargs' , 1 ) kwargs . setdefault ( 'type' , 'string' ) if ( kwargs . get ( 'action' ) == 'append' ) : kwargs [ 'default' ] = [ ] else : kwargs [ 'default' ] = None parser . add_option ( * args , ** kwargs ) if ( deprecated_aliases and include_deprecated ) : help = ( 'Deprecated alias%s for %s' % ( ( 'es' if ( len ( deprecated_aliases ) > 1 ) else '' ) , args [ ( - 1 ) ] ) ) parser . add_option ( * deprecated_aliases , ** combine_dicts ( kwargs , dict ( help = help ) ) )
add switches for a single option to the given parser .