shithub: drawterm

Download patch

ref: c1f45eb46dfc4e7bc5afd1d2e2e4308398b4d924
parent: 1077af5bb8c70351814b5a0042020116b23690d6
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Apr 17 14:21:23 EDT 2016

add -O option to disable new rcpu protocol, accept -h option just like cpu

--- a/cpu.c	Sun Apr 17 13:19:59 2016
+++ b/cpu.c	Sun Apr 17 14:21:23 2016
@@ -27,6 +27,7 @@
 static int	findkey(Authkey*, char*, char*, char*);
 
 static char	*host;
+static int	norcpu;
 static int	nokbd;
 static int	cflag;
 extern int	dbg;
@@ -50,7 +51,7 @@
 void
 usage(void)
 {
-	fprint(2, "usage: drawterm [-a authserver] [-c cpuserver] [-s secstore] [-u user] [-r root]\n");
+	fprint(2, "usage: drawterm [-BOp] [-h host | -c cpuserver] [-a authserver] [-s secstore] [-u user] [-r root]\n");
 	exits("usage");
 }
 
@@ -200,6 +201,7 @@
 	case 'a':
 		authserver = EARGF(usage());
 		break;
+	case 'h':
 	case 'c':
 		host = EARGF(usage());
 		break;
@@ -226,18 +228,21 @@
 			strcat(cmd, p);
 		}
 		break;
-	case 'k':
-		keyspec = EARGF(usage());
-		break;
 	case 's':
 		secstoreserver = EARGF(usage());
 		break;
+	case 'k':
+		keyspec = EARGF(usage());
+		break;
 	case 'u':
 		user = EARGF(usage());
 		break;
 	case 'B':
 		nokbd = 1;
 		break;
+	case 'O':
+		norcpu = 1;
+		break;
 	case 'p':
 		aanfilter = 1;
 		break;
@@ -273,7 +278,8 @@
 		}
 	}
 
-	rcpu(host);
+	if(!norcpu)
+		rcpu(host);
 
 	if((err = rexcall(&data, host, srvname)))
 		fatal(1, "%s: %s", err, host);