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