def main():
    """ Repository maintenance. """

    usage = """\
%prog OP [options] repository, where OP may be:
   check  -- check for lock
   lock   -- lock repository
   unlock -- unlock repository
   set    -- set this as current repository
             (sets OPENMDAO_REPO environment variable and starts a new shell)
   fix    -- fix permissions and remove generated directories
   rmpyc  -- remove 'orphan' .pyc files"""

    parser = optparse.OptionParser(usage)
    parser.add_option('-f', '--force', action='store_true',
                      default=False, help='forced unlock')
    parser.add_option('-v', '--verbose', action='store_true',
                      default=False, help='print info messages')
    try:
        operation = sys.argv.pop(1)
    except __HOLE__:
        parser.print_help()
        sys.exit(1)
    options, arguments = parser.parse_args()
    repository = ''
    if len(arguments) > 0:
        if len(arguments) == 1:
            repository = arguments[0]
        else:
            parser.print_help()
            sys.exit(1)
    if not repository:
        try:
            repository = os.environ['OPENMDAO_REPO']
        except KeyError:
            pass

    this_user = get_username()
    path = find_repository(repository, this_user)
    if not path:
        print 'Cannot find repository!'
        sys.exit(2)
    if options.verbose:
        print 'Repository root:', path

    if operation == 'check':
        do_check(path)
    elif operation == 'lock':
        do_lock(path)
    elif operation == 'unlock':
        do_unlock(path, options)
    elif operation == 'set':
        do_set(path, this_user)
    elif operation == 'fix':
        do_fix(path, options)
        do_rmpyc(path)
    elif operation == 'rmpyc':
        do_rmpyc(path)
    else:
        parser.print_help()
        sys.exit(1)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/scripts/repo.py/main