[SERVER-19048] shell types a help message even when --quiet flag is specified Created: 19/Jun/15  Updated: 15/Aug/18  Resolved: 15/Aug/18

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.6.10
Fix Version/s: 4.1.2

Type: Bug Priority: Trivial - P5
Reporter: Asya Kamsky Assignee: Asya Kamsky
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-23810 Don't Print Shell Log Messages to STD... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

% mongo
MongoDB shell version: 3.1.3
connecting to: test
> exit
% mongo --quiet
> exit
% mongo --shell
MongoDB shell version: 3.1.3
connecting to: test
type "help" for help
> exit
% mongo --quiet --shell
type "help" for help
> 

The culprit seems to be this line (not even sure why it's there):
https://github.com/mongodb/mongo/blob/449e0f2b47e32060433cb6f68d967ea53c8573d1/src/mongo/shell/dbshell.cpp#L688-L689

Instead of

 if( shellGlobalParams.runShell )

it should be

 if( shellGlobalParams.runShell && !mongo::serverGlobalParams.quiet )



 Comments   
Comment by Githook User [ 15/Aug/18 ]

Author:

{'name': 'Asya Kamsky', 'email': 'asya999@gmail.com', 'username': 'asya999'}

Message: SERVER-19048 Don't print "type help" when --quiet option is given.

Closes #1256.

Signed-off-by: Max Hirschhorn <max.hirschhorn@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/05663e5a4293d031d9581bde787d94c46f78a56e

Comment by Asya Kamsky [ 07/Aug/18 ]

PR: https://github.com/mongodb/mongo/pull/1256

 

Comment by Asya Kamsky [ 19/Jun/15 ]

In fact, I think that line should simply not be printed - why would we print "type help for help" but specifically only when the --shell option was used (meaning a JS file was passed to mongo but it was still put into interactive mode).

Generated at Thu Feb 08 03:49:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.