def get_option_for(opt_name, config):
    """Returns a pair [opt_tuple, opt_dict] where 'opt_tuple'
    represents short and long options and 'opt_dict' represents other
    parameters required by OptionParser.add_option() method. An example of
    usage is:

    parms = get_option_for('--dir', config)
    opt_parser.add_option(*parms[0], **parms[1])
    """
    if opt_name == '--Enforce':
        return [['-E', opt_name], {'dest': 'enforce', 'action':
            'store_true', 'default': False, 'help': 
            'Do not ask for a confirmation. ' + 'Default is %default.'}]
    if opt_name == '--out':
        return [['-o', opt_name], {'metavar': 'FILE', 'dest': 'out', 'type':
            'string', 'default': '-', 'help':
            'Use the given output FILE instead of stdout.'}]
    if opt_name == '--depgraphto':
        return [[opt_name], {'metavar': 'FILE', 'dest': 'depgraphto',
            'type': 'string', 'help': 
            'Write the dependency graph in DOT format' +
            ' to the given FILE. ' +
            ' Use Graphviz dotty command for visualisation.'}]
    if opt_name == '--file':
        return [['-f', opt_name], {'metavar': 'FILE', 'dest': 'src', 'type':
            'string', 'default': '-', 'help':
            'Use the given input FILE instead of stdin.'}]
    import sequencer.ism.cli as ism_cli
    if opt_name == '--algo':
        return [[opt_name], {'dest': 'algo', 'type': 'choice', 'action':
            'store', 'choices': ism_cli.ALGO_TYPES.keys(), 'default':
            config.get(ism_cli.SEQMAKE_ACTION_NAME, 'algo'), 'help': 
            'Use the given algorithm. Can be one of: ' + ', '.join(ism_cli.
            ALGO_TYPES.keys()) + '. Default: %default'}]
    if opt_name == '--actionsgraphto':
        return [[opt_name], {'metavar': 'FILE', 'dest': 'actionsgraphto',
            'type': 'string', 'help': 'Write the actions dependency graph' +
            ' in DOT format' + ' to the given FILE. ' +
            ' Use Graphviz dotty command for' + ' visualisation.'}]
    import sequencer.ise.cli as ise_cli
    if opt_name == '--progress':
        return [[opt_name], {'metavar': 'n', 'dest': 'progress', 'type':
            'float', 'default': config.getfloat(ise_cli.SEQEXEC_ACTION_NAME,
            'progress'), 'help': 'Display a progress report every ' +
            'n seconds (roughly). If n=0, do not display any ' +
            'progress. Default: %default'}]
    if opt_name == '--doexec':
        return [[opt_name], {'dest': 'doexec', 'metavar': '[yes|no]',
            'type': 'choice', 'action': 'store', 'choices': ['yes', 'no'],
            'default': config.get(ise_cli.SEQEXEC_ACTION_NAME, 'doexec'),
            'help': "If 'no', *do not* execute anything." +
            " This is often used with '--report model'" +
            " and/or  '--actionsgraphto' options in order to " +
            '"see" what will be done before the actual execution.' +
            ' Default: %default'}]
    if opt_name == '--report':
        return [[opt_name], {'dest': 'report', 'type': 'choice', 'metavar':
            'type', 'action': 'store', 'choices': ise_cli.REPORT_TYPES,
            'default': config.get(ise_cli.SEQEXEC_ACTION_NAME, 'report'),
            'help': 'Display a report.' + ' Can be one of: ' + ', '.join(
            ise_cli.REPORT_TYPES) + '. Default: %default'}]
    if opt_name == '--dostats':
        return [[opt_name], {'dest': 'dostats', 'metavar': '[yes|no]',
            'type': 'choice', 'action': 'store', 'choices': ['yes', 'no'],
            'default': config.get(ise_cli.SEQEXEC_ACTION_NAME, 'dostats'),
            'help': "If 'yes', display statistics. Default: %default."}]
    if opt_name == '--fanout':
        return [[opt_name], {'metavar': 'n', 'dest': 'fanout', 'type':
            'int', 'default': config.getint(ise_cli.SEQEXEC_ACTION_NAME,
            'fanout'), 'help': 'Launch a maximum of n actions in parallel.' +
            ' Default: %default'}]
    if opt_name == '--nodeps':
        return [[opt_name], {'dest': 'nodeps', 'action': 'store_true',
            'default': False, 'help': 'Do not update references from ' +
            'other rules in the same ruleset.'}]
    import sequencer.dgm.cli as dgm_cli
    if opt_name == '--docache':
        return [[opt_name], {'dest': 'docache', 'metavar': '[yes|no]',
            'type': 'choice', 'action': 'store', 'choices': ['yes', 'no'],
            'default': config.get(dgm_cli.DEPMAKE_ACTION_NAME, 'docache'),
            'help': 'Use a cache for filtering decision. Default: %default'}]
    raise ValueError('Unknown option: %s' % opt_name)
