# Author:       Li Junhao           l@x-cmd.com                             # xrc
# shellcheck    shell=sh            disable=SC2039,SC1090,SC3043,SC2263

# license:      GPLv3

x log init jsch
xrc:mod:lib jsch      from to

# x jsch `x w1 a.json` b.ts
# x jsch @=a.json b.ts

___x_cmd_jsch(){
    # local op="$1";
    # if command -v "___x_cmd_jsch_$op" 2>/dev/null; then
    #     shift 1
    #     "___x_cmd_jsch_$op" "$@"
    #     return
    # fi

    local op="$1";
    case "$op" in
        from)   shift;  ___x_cmd_jsch_from "$@" ;;
        to)     shift;  ___x_cmd_jsch_to "$@" ;;
        -h|--help)      ___x_cmd_jsch_help   ;;
        *.json)         ___x_cmd_jsch_to    "$@" ;;
        *.*)            ___x_cmd_jsch_from  "$@" ;;
        *)              echo "Not Implemented." >/dev/stderr
    esac

}

___x_cmd_jsch_help(){
    x help -m jsch >&2
    return 1
}

xrc setmain ___x_cmd_jsch
