
xrc:mod:lib     uhb     host/ls host/util

___x_cmd_uhb_host(){
    [ "$#" -gt 0 ] ||   set -- ls

    local op="$1";      shift
    case "$op" in
        -h|--help)      ___x_cmd help -m uhb host "$@"
                        return 0  ;;

        install|uninstall|\
        ls|gen)
                        ___x_cmd_uhb_host_"$op" "$@" ;;
        *)              ;;
    esac
}

___x_cmd_uhb_host_uninstall(){
    ___x_cmd_uhb_host_cleanup
}

___x_cmd_uhb_host_install(){
    ___x_cmd_uhb_host_cleanup || true

    local fp="$___X_CMD_ROOT_TMP/uhb/hosts/tmp"

    ___x_cmd_uhb_host_gen "$@" >"$fp"
    ___x_cmd sudo cp "$fp" /etc/hosts
}
