
# x install --sys vim curl emacs
# x install --sys --tool apk vim curl emacs
# x install --sys --tool dnf vim curl emacs

___x_cmd_install_sys(){

    local tool=""
    while [ $# -gt 0 ]; do
        case "$1" in
            -h|--help)      ___x_cmd help -m install --sys "$@" ; return 0 ;;
            --tool|-t)      tool="$2";      arg:2:shift ;;
            --)             shift; break    ;;
            *)              break ;;
        esac
    done

    local x_=""
    [ -n "$tool" ] || {
        ___x_cmd_install_sys___tool_ || return 1
        tool="$x_"
    }

    ___x_cmd_install_withtool "$tool"   "$@"
}


___x_cmd_install_sys___tool_(){
    x_=""
    if      ___x_cmd os is  win;        then        x_=winget
    elif    ___x_cmd_hascmd brew;       then        x_=brew
    elif    ___x_cmd_hascmd apt;        then        x_=apt
    elif    ___x_cmd_hascmd dnf;        then        x_=dnf
    elif    ___x_cmd_hascmd yum;        then        x_=yum
    elif    ___x_cmd_hascmd apk;        then        x_=apk
    elif    ___x_cmd_hascmd pacman;     then        x_=pacman
    else
            return 1
    fi
}
