Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: ztcp -v
- X-seq: zsh-workers 15763
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: ztcp -v
- Date: Sat, 8 Sep 2001 17:40:16 -0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Default to easily-parsable.
Index: Src/Modules/tcp.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/tcp.c,v
retrieving revision 1.5
diff -u -r1.5 tcp.c
--- Src/Modules/tcp.c 2001/09/08 21:09:56 1.5
+++ Src/Modules/tcp.c 2001/09/08 21:35:30
@@ -381,13 +381,16 @@
static int
bin_ztcp(char *nam, char **args, char *ops, int func)
{
- int herrno, err=1, destport, force=0, len;
+ int herrno, err=1, destport, force=0, verbose=0, len;
char **addrp, *desthost;
struct hostent *zthost = NULL;
Tcp_session sess;
if (ops['f'])
force=1;
+
+ if (ops['v'])
+ verbose=1;
if (ops['c']) {
if (!args[0]) {
@@ -473,7 +476,10 @@
zwarnnam(nam, "connection failed: %e", NULL, errno);
else
{
- fprintf(shout, "%s:%d is now on fd %d\n", desthost, destport, sess->fd);
+ if(verbose)
+ fprintf(shout, "%s:%d is now on fd %d\n", desthost, destport, sess->fd);
+ else
+ fprintf(shout, "%d\n", sess->fd);
}
zsfree(desthost);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author