def disable_autocomplete_handler()

in modular_cli/modular_cli_autocomplete/complete_handler.py [0:0]


def disable_autocomplete_handler():
    interpreter, script = _get_interpreter_and_appropriate_script()
    try:
        _delete_str_from_rc_file(interpreter)
        if os.path.exists(PROFILE_D_PATH):
            for each in os.listdir(PROFILE_D_PATH):
                if each in [ZSH_COMPLETE_SCRIPT,
                            BASH_COMPLETE_SCRIPT,
                            PROFILE_ZSH_COMPLETE_SCRIPT,
                            PROFILE_BASH_COMPLETE_SCRIPT]:
                    os.remove(os.path.join(PROFILE_D_PATH, each))
        return 'Modular-CLI autocomplete has been ' \
               'successfully deleted'
    except Exception as e:
        _LOG.info(f'Something happen while removing autocomplete. Reason: {e}')
        raise Exception(f'Something happen while removing '
                        f'autocomplete. Reason: {e}')