Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168426731
D30819.id91087.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D30819.id91087.diff
View Options
Index: contrib/telnet/telnet/commands.c
===================================================================
--- contrib/telnet/telnet/commands.c
+++ contrib/telnet/telnet/commands.c
@@ -122,6 +122,7 @@
static char saveline[256];
static int margc;
static char *margv[20];
+int quiet_mode;
#ifdef OPIE
#include <sys/wait.h>
@@ -2042,7 +2043,8 @@
status(int argc, char *argv[])
{
if (connected) {
- printf("Connected to %s.\n", hostname);
+ if (!quiet_mode)
+ printf("Connected to %s.\n", hostname);
if ((argc < 2) || strcmp(argv[1], "notmuch")) {
int mode = getconnmode();
@@ -2071,7 +2073,8 @@
} else {
printf("No connection.\n");
}
- printf("Escape character is '%s'.\n", control(escape));
+ if (!quiet_mode)
+ printf("Escape character is '%s'.\n", control(escape));
(void) fflush(stdout);
return 1;
}
@@ -2264,7 +2267,8 @@
memset(&su, 0, sizeof su);
su.sun_family = AF_UNIX;
strncpy(su.sun_path, hostp, sizeof su.sun_path);
- printf("Trying %s...\n", hostp);
+ if (!quiet_mode)
+ printf("Trying %s...\n", hostp);
net = socket(PF_UNIX, SOCK_STREAM, 0);
if ( net < 0) {
perror("socket");
@@ -2373,7 +2377,8 @@
}
}
do {
- printf("Trying %s...\n", sockaddr_ntop(res->ai_addr));
+ if (!quiet_mode)
+ printf("Trying %s...\n", sockaddr_ntop(res->ai_addr));
net = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
setuid(getuid());
if (net < 0) {
@@ -2491,7 +2496,10 @@
(void) call(status, "status", "notmuch", 0);
telnet(user);
(void) NetClose(net);
- ExitString("Connection closed by foreign host.\n",1);
+ if (quiet_mode)
+ ExitString("",1);
+ else
+ ExitString("Connection closed by foreign host.\n",1);
/*NOTREACHED*/
fail:
if (res0 != NULL)
Index: contrib/telnet/telnet/main.c
===================================================================
--- contrib/telnet/telnet/main.c
+++ contrib/telnet/telnet/main.c
@@ -63,6 +63,7 @@
#endif
extern int tos;
+extern int quiet_mode;
int family = AF_UNSPEC;
@@ -152,7 +153,7 @@
#define IPSECOPT
#endif
while ((ch = getopt(argc, argv,
- "468B:EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1)
+ "468B:EKLNQS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1)
#undef IPSECOPT
{
switch(ch) {
@@ -184,6 +185,9 @@
case 'N':
doaddrlookup = 0;
break;
+ case 'Q':
+ quiet_mode = 1;
+ break;
case 'S':
#ifdef HAS_GETTOS
Index: contrib/telnet/telnet/telnet.1
===================================================================
--- contrib/telnet/telnet/telnet.1
+++ contrib/telnet/telnet/telnet.1
@@ -38,7 +38,7 @@
protocol
.Sh SYNOPSIS
.Nm
-.Op Fl 468EFKLNacdfruxy
+.Op Fl 468EFKLNQacdfruxy
.Op Fl B Ar baudrate
.Op Fl S Ar tos
.Op Fl X Ar authtype
@@ -108,6 +108,8 @@
.It Fl N
Prevents IP address to name lookup when destination host is given
as an IP address.
+.It Fl Q
+Quiet mode.
.It Fl S Ar tos
Sets the IP type-of-service (TOS) option for the telnet
connection to the value
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 29, 6:33 AM (14 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37499448
Default Alt Text
D30819.id91087.diff (2 KB)
Attached To
Mode
D30819: telnet(1): add quiet mode
Attached
Detach File
Event Timeline
Log In to Comment