# shellcheck shell=dash

# TODO: support multiple file put and put dir
___x_cmd_hub_file_put(){
    local X_help_cmd='___x_cmd_hub___help file put'
    help:arg-null:parse

    local public=; local force=
    while [ $# -gt 0 ] ; do
        case "$1" in
            --public|-p)     public=true; shift ;;
            --force|-f)      force=true;  shift ;;
            *) break ;;
        esac
    done

    local localfp="$1"; ___x_cmd_hub_file___localfp_is_exist "$localfp" || return 1
    local remotefp=;    remotefp="$(___x_cmd_hub_file___remotefp "$localfp" "$2")"
    hub:debug "localfp=$localfp, remotefp=$remotefp"

    ___x_cmd_hub_file___upload_file "$localfp" "$remotefp" "$force" "$public" || return 1
}
