From 2861a64889384880a2f25c93fa3e7ced80805b0d Mon Sep 17 00:00:00 2001 From: Zituo Jin Date: Wed, 22 Sep 2021 15:03:23 +0000 Subject: SERVER-59883 suppress deprecation message with quiet flag --- src/mongo/shell/mongo_main.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mongo/shell/mongo_main.cpp b/src/mongo/shell/mongo_main.cpp index 811f896535c..c48fb46c742 100644 --- a/src/mongo/shell/mongo_main.cpp +++ b/src/mongo/shell/mongo_main.cpp @@ -944,16 +944,16 @@ int mongo_main(int argc, char* argv[]) { bool lastLineSuccessful = true; if (shellGlobalParams.runShell) { - std::cout << "================\n" - "Warning: the \"mongo\" shell has been superseded by \"mongosh\",\n" - "which delivers improved usability and compatibility." - "The \"mongo\" shell has been deprecated and will be removed in\n" - "an upcoming release.\n" - "We recommend you begin using \"mongosh\".\n" - "For installation instructions, see\n" - "https://docs.mongodb.com/mongodb-shell/install/\n" - "================" - << std::endl; + if (!mongo::serverGlobalParams.quiet.load()) + std::cout << "================\n" + "Warning: the \"mongo\" shell has been superseded by \"mongosh\",\n" + "which delivers improved usability and compatibility." + "The \"mongo\" shell has been deprecated and will be removed in\n" + "an upcoming release.\n" + "For installation instructions, see\n" + "https://docs.mongodb.com/mongodb-shell/install/\n" + "================" + << std::endl; mongo::shell_utils::MongoProgramScope s; // If they specify norc, assume it's not their first time -- cgit v1.2.1