From 0165ab48c0883baf1a58e98b53425938580921dd Mon Sep 17 00:00:00 2001 From: 502647092 Date: Thu, 30 Aug 2018 22:16:18 +0800 Subject: [PATCH] fix: error time clear clipboard --- README.MD | 10 +++++++++- main.go | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) 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) }