def _get_adjust_options(options, version):
    """Return a string containing the definition of the adjust_options function
    that will be included in the generated virtualenv bootstrapping script.
    """
    if options.dev:
        code = """
    for arg in args:
        if not arg.startswith('-'):
            print 'ERROR: no args allowed that start without a dash (-)'
            sys.exit(-1)
    args.append(join(os.path.dirname(__file__), 'devenv'))  # force the virtualenv to be in <top>/devenv
"""
    else:
        code = """
    # name of virtualenv defaults to openmdao-<version>
    if len(args) == 0:
        args.append('openmdao-%%s' %% '%s')
""" % version
    
    return """
def adjust_options(options, args):
    major_version = sys.version_info[:2]
    if major_version < (2,6) or major_version > (3,0):
        print 'ERROR: python major version must be 2.6 or 2.7. yours is %%s' %% str(major_version)
        sys.exit(-1)
%s

""" % code