diff --git a/README.MD b/README.MD index cc042a9..12ff56e 100644 --- a/README.MD +++ b/README.MD @@ -1,7 +1,15 @@ ## clipboard-sync +### CommandLineArgs + +- `-t` Launch Type + - `s` Server + - `c` Client +- `-b` Bind Address (Server Only) Default `:8080` +- `-a` Server Address(Client Only) Default `http://127.0.0.1:8080` + ### Server -./clipboard-sync -t s +./clipboard-sync -t s -b :8080 ### Client ./clipboard-sync -a http://172.30.34.2:8080 \ No newline at end of file diff --git a/main.go b/main.go index adb5a5c..0378fdb 100644 --- a/main.go +++ b/main.go @@ -69,7 +69,7 @@ func readClipboard(a string) { sTime, _ := strconv.ParseInt(response.Header[timeHeader][0], 10, 64) if sTime > updateTime && sText != old { old = sText - updateTime = time.Now().Unix() + updateTime = sTime clipboard.WriteAll(sText) fmt.Printf("Update Clipboard: %s\n", sText) }