! 31 Mar 89		Terry Lambert
!
! tofrompc.cmd - this file is called via 'term -x tofrompc <dir> <file> <file>'
! the remote (usually DOS) TERM must be running with either -c or 'set
! control on' to work
!
? " \$1 $1"
? " \$2 $2"
? " \$3 $3"
? " \$4 $4"
? " \$5 $5"
setv option tolower("$1")
switch
case option="from"
    if "$2"="" | "$3"="" | "$4" !=""
	xmit "Usage: frompc pcfile unixfile[options]\r\n"
	quit
    endif

    iferror get $2 $3
	xmit "frompc: could not get file $2 or could not write file $3\r\n"
    endif
case option="to"
    if "$2"="" | "$3"="" | "$4" !=""
	xmit "Usage: topc unixfile pcfile[options]\r\n"
	quit
    endif
    iferror xfer $2 $3
	xmit "topc: could not read file $2 or could not write file $3\r\n"
    endif
default
    xmit "tofrompc.cmd: invalid parameter '$1'\r\n"
endswitch
quit
