0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00
This commit is contained in:
Zack Scholl 2019-04-12 20:57:10 -07:00
parent 724de7e3c2
commit ba07215226
5 changed files with 130 additions and 173 deletions

46
main.go
View file

@ -1,10 +1,9 @@
package main
import (
"flag"
"fmt"
"github.com/schollz/croc/v5/src/croc"
"github.com/schollz/croc/v5/src/cli"
)
func main() {
@ -24,26 +23,29 @@ func main() {
// }
// log.Debugln(bytes.Equal(buffer[:bytesread], emptyBuffer[:bytesread]))
// }
var sender bool
flag.BoolVar(&sender, "sender", false, "sender")
flag.Parse()
c, err := croc.New(sender, "foo")
if err != nil {
panic(err)
}
if sender {
err = c.Send(croc.TransferOptions{
// PathToFile: "../wskeystore/README.md",
// PathToFile: "./src/croc/croc.go",
// PathToFiles: []string{"C:\\Users\\zacks\\go\\src\\github.com\\schollz\\croc\\src\\croc\\croc.go", "croc.exe"},
PathToFiles: []string{"croc2.exe", "croc3.exe"}, //,"croc2.exe", "croc3.exe"},
//PathToFiles: []string{"README.md"}, //,"croc2.exe", "croc3.exe"},
KeepPathInRemote: false,
})
} else {
err = c.Receive()
}
if err != nil {
// var sender bool
// flag.BoolVar(&sender, "sender", false, "sender")
// flag.Parse()
// c, err := croc.New(sender, "foo")
// if err != nil {
// panic(err)
// }
// if sender {
// err = c.Send(croc.TransferOptions{
// // PathToFile: "../wskeystore/README.md",
// // PathToFile: "./src/croc/croc.go",
// // PathToFiles: []string{"C:\\Users\\zacks\\go\\src\\github.com\\schollz\\croc\\src\\croc\\croc.go", "croc.exe"},
// PathToFiles: []string{"croc2.exe", "croc3.exe"}, //,"croc2.exe", "croc3.exe"},
// //PathToFiles: []string{"README.md"}, //,"croc2.exe", "croc3.exe"},
// KeepPathInRemote: false,
// })
// } else {
// err = c.Receive()
// }
// if err != nil {
// fmt.Println(err)
// }
if err := cli.Run(); err != nil {
fmt.Println(err)
}
}