a1ef07
From a922e4e22c470fbfc7ef1b1ac1645a81f59d1846 Mon Sep 17 00:00:00 2001
a1ef07
From: Justin Stephenson <jstephen@redhat.com>
a1ef07
Date: Mon, 25 Jun 2018 09:58:56 -0400
a1ef07
Subject: [PATCH 1/2] s3:client: Add --quiet option to smbclient
a1ef07
MIME-Version: 1.0
a1ef07
Content-Type: text/plain; charset=UTF-8
a1ef07
Content-Transfer-Encoding: 8bit
a1ef07
a1ef07
Add quiet command-line argument to allow suppressing the help log
a1ef07
message printed automatically after establishing a smbclient connection
a1ef07
a1ef07
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13485
a1ef07
a1ef07
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
a1ef07
Reviewed-by: Andreas Schneider <asn@samba.org>
a1ef07
Reviewed-by: Björn Baumbach <bb@sernet.de>
a1ef07
(cherry picked from commit 89a8b3ecd47b6d9a33e66f22d2786f0ae3b4cb72)
a1ef07
---
a1ef07
 source3/client/client.c | 9 ++++++++-
a1ef07
 1 file changed, 8 insertions(+), 1 deletion(-)
a1ef07
a1ef07
diff --git a/source3/client/client.c b/source3/client/client.c
a1ef07
index 2c1c76036f7..c836e5a0477 100644
a1ef07
--- a/source3/client/client.c
a1ef07
+++ b/source3/client/client.c
a1ef07
@@ -52,6 +52,7 @@ static int port = 0;
a1ef07
 static char *service;
a1ef07
 static char *desthost;
a1ef07
 static bool grepable = false;
a1ef07
+static bool quiet = false;
a1ef07
 static char *cmdstr = NULL;
a1ef07
 const char *cmd_ptr = NULL;
a1ef07
a1ef07
@@ -6059,7 +6060,9 @@ static int process_stdin(void)
a1ef07
 {
a1ef07
	int rc = 0;
a1ef07
a1ef07
-	d_printf("Try \"help\" to get a list of possible commands.\n");
a1ef07
+	if (!quiet) {
a1ef07
+		d_printf("Try \"help\" to get a list of possible commands.\n");
a1ef07
+	}
a1ef07
a1ef07
	while (!finished) {
a1ef07
		TALLOC_CTX *frame = talloc_stackframe();
a1ef07
@@ -6329,6 +6332,7 @@ int main(int argc,char *argv[])
a1ef07
		{ "timeout", 't', POPT_ARG_INT, &io_timeout, 'b', "Changes the per-operation timeout", "SECONDS" },
a1ef07
		{ "port", 'p', POPT_ARG_INT, &port, 'p', "Port to connect to", "PORT" },
a1ef07
		{ "grepable", 'g', POPT_ARG_NONE, NULL, 'g', "Produce grepable output" },
a1ef07
+		{ "quiet", 'q', POPT_ARG_NONE, NULL, 'q', "Suppress help message" },
a1ef07
                 { "browse", 'B', POPT_ARG_NONE, NULL, 'B', "Browse SMB servers using DNS" },
a1ef07
		POPT_COMMON_SAMBA
a1ef07
		POPT_COMMON_CONNECTION
a1ef07
@@ -6451,6 +6455,9 @@ int main(int argc,char *argv[])
a1ef07
		case 'g':
a1ef07
			grepable=true;
a1ef07
			break;
a1ef07
+		case 'q':
a1ef07
+			quiet=true;
a1ef07
+			break;
a1ef07
		case 'e':
a1ef07
			smb_encrypt=true;
a1ef07
			break;
a1ef07
--
a1ef07
2.17.1