'Checks arguments and runs export function if they are good'

def handle(self, *args, **options):

    if (len(args) != 2):
        raise CommandError('This    script    requires    exactly    two    arguments:    course_loc    and    git_url')
    try:
        course_key = CourseKey.from_string(args[0])
    except InvalidKeyError:
        try:
            course_key = SlashSeparatedCourseKey.from_deprecated_string(args[0])
        except InvalidKeyError:
            raise CommandError(unicode(GitExportError.BAD_COURSE))
    try:
        git_export_utils.export_to_git(course_key, args[1], options.get('user', ''), options.get('rdir', None))
    except git_export_utils.GitExportError as ex:
        raise CommandError(unicode(ex.message))
