diff options
Diffstat (limited to 'src/mongo/shell/shell_options.h')
-rw-r--r-- | src/mongo/shell/shell_options.h | 91 |
1 files changed, 45 insertions, 46 deletions
diff --git a/src/mongo/shell/shell_options.h b/src/mongo/shell/shell_options.h index a61e58ce9bf..cc4edb8e3e5 100644 --- a/src/mongo/shell/shell_options.h +++ b/src/mongo/shell/shell_options.h @@ -36,65 +36,64 @@ namespace mongo { - namespace optionenvironment { - class OptionSection; - class Environment; - } // namespace optionenvironment +namespace optionenvironment { +class OptionSection; +class Environment; +} // namespace optionenvironment - namespace moe = mongo::optionenvironment; +namespace moe = mongo::optionenvironment; - struct ShellGlobalParams { - std::string url; - std::string dbhost; - std::string port; - std::vector<std::string> files; +struct ShellGlobalParams { + std::string url; + std::string dbhost; + std::string port; + std::vector<std::string> files; - std::string username; - std::string password; - bool usingPassword; - std::string authenticationMechanism; - std::string authenticationDatabase; - std::string gssapiServiceName; - std::string gssapiHostName; + std::string username; + std::string password; + bool usingPassword; + std::string authenticationMechanism; + std::string authenticationDatabase; + std::string gssapiServiceName; + std::string gssapiHostName; - bool runShell; - bool nodb; - bool norc; + bool runShell; + bool nodb; + bool norc; - std::string script; + std::string script; - bool autoKillOp; - bool useWriteCommandsDefault; - std::string writeMode; + bool autoKillOp; + bool useWriteCommandsDefault; + std::string writeMode; - std::string readMode; + std::string readMode; - rpc::ProtocolSet rpcProtocols; + rpc::ProtocolSet rpcProtocols; - ShellGlobalParams() : autoKillOp(false), - useWriteCommandsDefault(true), - writeMode("commands"), - readMode("compatibility"), - rpcProtocols(rpc::supports::kOpQueryOnly) { - } - }; + ShellGlobalParams() + : autoKillOp(false), + useWriteCommandsDefault(true), + writeMode("commands"), + readMode("compatibility"), + rpcProtocols(rpc::supports::kOpQueryOnly) {} +}; - extern ShellGlobalParams shellGlobalParams; +extern ShellGlobalParams shellGlobalParams; - Status addMongoShellOptions(moe::OptionSection* options); +Status addMongoShellOptions(moe::OptionSection* options); - std::string getMongoShellHelp(StringData name, const moe::OptionSection& options); +std::string getMongoShellHelp(StringData name, const moe::OptionSection& options); - /** - * Handle options that should come before validation, such as "help". - * - * Returns false if an option was found that implies we should prematurely exit with success. - */ - bool handlePreValidationMongoShellOptions(const moe::Environment& params, - const std::vector<std::string>& args); +/** + * Handle options that should come before validation, such as "help". + * + * Returns false if an option was found that implies we should prematurely exit with success. + */ +bool handlePreValidationMongoShellOptions(const moe::Environment& params, + const std::vector<std::string>& args); - Status storeMongoShellOptions(const moe::Environment& params, - const std::vector<std::string>& args); +Status storeMongoShellOptions(const moe::Environment& params, const std::vector<std::string>& args); - Status validateMongoShellOptions(const moe::Environment& params); +Status validateMongoShellOptions(const moe::Environment& params); } |