# shellcheck shell=dash

___x_cmd_mac_restart(){
    [ $# -gt 0 ]    ||  set -- --normal
    case "$1" in
        -h|--help)  ___x_cmd help -m mac restart ;;
        -y|--yes)   ___x_cmd_mac_restart_confirm ;;
        --normal)   ___x_cmd_mac_restart_normal  ;;
        *)          N=mac M="Unknown argument -> $1" log:ret:64 ;;
    esac
}

___x_cmd_mac_restart_confirm(){
    ___x_cmd_mac___cmd osascript -e 'tell app "loginwindow" to «event aevtrrst»'
}

___x_cmd_mac_restart_normal(){
    ___x_cmd_mac___cmd osascript -e 'tell app "System Events" to restart'
}
