From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22204 invoked from network); 8 Sep 2001 21:40:33 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Sep 2001 21:40:33 -0000 Received: (qmail 11904 invoked by alias); 8 Sep 2001 21:40:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15763 Received: (qmail 11889 invoked from network); 8 Sep 2001 21:40:18 -0000 Date: Sat, 8 Sep 2001 17:40:16 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: ztcp -v Message-ID: <20010908174016.A32255@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i 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);