def rerender_options(options):
    """Helper function to re-render command-line options.

    This assumes that command-line options use the same name as their
    key in the options dictionary.
    """
    args = []
    for name, value in options.iteritems():
        name = name.replace('_', '-')
        if value is None:
            pass
        elif isinstance(value, bool):
            if value:
                args.append('--%s' % (name,))
        elif isinstance(value, list):
            for item in value:
                args.append('--%s=%s' % (name, item))
        else:
            args.append('--%s=%s' % (name, value))
    return ' '.join(args)
