# shellcheck shell=dash

___x_cmd_mac_logout(){
    [ $# -gt 0 ]    ||  set -- --yes

    case "$1" in
        -h|--help)      ___x_cmd help -m mac logout                 ;;
        -y|--yes)       ___x_cmd_mac_logout_confirm                 ;;
        # --normal)       ___x_cmd_mac_logout_normal                  ;;
        *)              N=mac M="Unknown argument -> $1" log:ret:64 ;;
    esac
}

# Bug: 28:44: execution error: “System Events”遇到一个错误：“«event aevtrsdn»”不能继续。 (-1708)
# ___x_cmd_mac_logout_normal(){
#     osascript -e 'tell app "System Events" to «event aevtrsdn»'
# }

___x_cmd_mac_logout_confirm(){
    ___x_cmd_mac___cmd osascript -e 'tell app "System Events" to log out'
}

