# shellcheck shell=dash

___x_cmd_webtop_all(){
    [ $# -gt 0 ] ||     set -- --app

    local op="$1";  shift
    case "$op" in
        --app)          ___x_cmd_webtop_all___app   ;;
        pause|unpause|stop|restart|start)
                        ___x_cmd_webtop "$op" --all ;;
        -h|--help)
                        ___x_cmd help -m webtop all ;;
        *)              N=webtop M="Unknown subcmd -> $op" log:ret:64
    esac
}



___x_cmd_webtop_all___app(){
    local id=
    local cmd=

    ___x_cmd ui select id,cmd       \
        "Be cautious !"             \
        "x webtop container pause   --all" \
        "x webtop container unpause --all" \
        "x webtop container stop    --all" \
        "x webtop container restart --all" \
        "x webtop container start   --all"      "return 1"  || return 1

    webtop:debug "run command -> $cmd"
    eval "$cmd"
}
