From 5a9bb42ee6cb7d46cbd9c84ae24f75e05392d0f0 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 29 Aug 2015 11:16:50 +0200 Subject: Clipboard and hostname in argument --- client.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'client.js') diff --git a/client.js b/client.js index 00d4abb..ef1812e 100755 --- a/client.js +++ b/client.js @@ -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){ -- cgit v1.2.3-70-g09d2