From: Justin Stephenson Date: Mon, 25 Jun 2018 13:58:56 +0000 (-0400) Subject: s3:client: Add --quiet option to smbclient X-Git-Tag: ldb-1.3.6~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de5bde9fdecf462af449312e2098f634ffa6f52a;p=thirdparty%2Fsamba.git s3:client: Add --quiet option to smbclient Add quiet command-line argument to allow suppressing the help log message printed automatically after establishing a smbclient connection BUG: https://bugzilla.samba.org/show_bug.cgi?id=13485 Signed-off-by: Justin Stephenson Reviewed-by: Andreas Schneider Reviewed-by: Björn Baumbach (cherry picked from commit 89a8b3ecd47b6d9a33e66f22d2786f0ae3b4cb72) --- diff --git a/source3/client/client.c b/source3/client/client.c index 2c1c76036f7..c836e5a0477 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -52,6 +52,7 @@ static int port = 0; static char *service; static char *desthost; static bool grepable = false; +static bool quiet = false; static char *cmdstr = NULL; const char *cmd_ptr = NULL; @@ -6059,7 +6060,9 @@ static int process_stdin(void) { int rc = 0; - d_printf("Try \"help\" to get a list of possible commands.\n"); + if (!quiet) { + d_printf("Try \"help\" to get a list of possible commands.\n"); + } while (!finished) { TALLOC_CTX *frame = talloc_stackframe(); @@ -6329,6 +6332,7 @@ int main(int argc,char *argv[]) { "timeout", 't', POPT_ARG_INT, &io_timeout, 'b', "Changes the per-operation timeout", "SECONDS" }, { "port", 'p', POPT_ARG_INT, &port, 'p', "Port to connect to", "PORT" }, { "grepable", 'g', POPT_ARG_NONE, NULL, 'g', "Produce grepable output" }, + { "quiet", 'q', POPT_ARG_NONE, NULL, 'q', "Suppress help message" }, { "browse", 'B', POPT_ARG_NONE, NULL, 'B', "Browse SMB servers using DNS" }, POPT_COMMON_SAMBA POPT_COMMON_CONNECTION @@ -6451,6 +6455,9 @@ int main(int argc,char *argv[]) case 'g': grepable=true; break; + case 'q': + quiet=true; + break; case 'e': smb_encrypt=true; break;