diff options
author | tomsmeding <hallo@tomsmeding.nl> | 2015-08-29 11:16:50 +0200 |
---|---|---|
committer | tomsmeding <hallo@tomsmeding.nl> | 2015-08-29 11:16:50 +0200 |
commit | 5a9bb42ee6cb7d46cbd9c84ae24f75e05392d0f0 (patch) | |
tree | ca8531abc26a8c1e5518c49db691c1c08f7bfd3c /client.js | |
parent | aba1fbae35b4e645bb296f6b6205b4cfb623835e (diff) |
Clipboard and hostname in argument
Diffstat (limited to 'client.js')
-rwxr-xr-x | client.js | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -5,9 +5,11 @@ var fs=require("fs"), http=require("http"), crypto=require("crypto"), dialog=require("dialog"), - kbd=require("kbd"); + kbd=require("kbd"), + toClipboard=require("to-clipboard"); -var HOSTNAME="localhost",HTTPPORT=42420; +var HOSTNAME=process.argv[2]||"tomsmeding.nl",HTTPPORT=42420; +console.log("Using server "+HOSTNAME); var userid="0",password="-"; @@ -150,7 +152,8 @@ function sendfile(fname,retries){ } console.log("Successful upload"); fs.unlink(fname); //not sync, take your time - dialog.info(body); + toClipboard.sync(body.trim()); + dialog.info(body+"\n(Copied to clipboard.)"); }); }); req.on("error",function(err){ |