Skip to content

Commit

Permalink
s3:client: Add --quiet option to smbclient
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Björn Baumbach <[email protected]>
  • Loading branch information
justin-stephenson authored and cryptomilk committed Jun 26, 2018
1 parent 113da7a commit 89a8b3e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source3/client/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -6066,7 +6067,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();
Expand Down Expand Up @@ -6336,6 +6339,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
Expand Down Expand Up @@ -6458,6 +6462,9 @@ int main(int argc,char *argv[])
case 'g':
grepable=true;
break;
case 'q':
quiet=true;
break;
case 'e':
smb_encrypt=true;
break;
Expand Down

0 comments on commit 89a8b3e

Please sign in to comment.