0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/db/cmdline.h

77 lines
2.6 KiB
C
Raw Normal View History

2009-08-25 16:24:44 +02:00
/**
* Copyright (C) 2008 10gen Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
2010-04-27 21:27:52 +02:00
#include "../pch.h"
2009-08-25 16:24:44 +02:00
namespace mongo {
2009-10-08 22:29:04 +02:00
2009-08-25 20:35:22 +02:00
/* command line options
*/
/* concurrency: OK/READ */
2009-08-25 16:24:44 +02:00
struct CmdLine {
2009-08-25 20:35:22 +02:00
int port; // --port
bool rest; // --rest
2009-10-08 22:29:04 +02:00
2010-04-13 19:22:42 +02:00
string replSet; // --replSet <seedlist>
2009-08-25 20:35:22 +02:00
string source; // --source
string only; // --only
2009-10-20 19:29:05 +02:00
2009-08-25 20:35:22 +02:00
bool quiet; // --quiet
2009-10-08 22:29:04 +02:00
bool notablescan; // --notablescan
bool prealloc; // --noprealloc
bool smallfiles; // --smallfiles
2009-10-16 17:36:38 +02:00
bool quota; // --quota
2009-10-20 19:29:05 +02:00
int quotaFiles; // --quotaFiles
2009-10-16 17:36:38 +02:00
bool cpu; // --cpu show cpu time periodically
2009-10-17 05:32:34 +02:00
long long oplogSize; // --oplogSize
int defaultProfile; // --profile
int slowMS; // --time in ms that is "slow"
2009-08-25 16:24:44 +02:00
enum {
DefaultDBPort = 27017,
ConfigServerPort = 27019,
ShardServerPort = 27018
2009-08-25 16:24:44 +02:00
};
CmdLine() :
port(DefaultDBPort), rest(false), quiet(false), notablescan(false), prealloc(true), smallfiles(false),
quota(false), quotaFiles(8), cpu(false), oplogSize(0), defaultProfile(0), slowMS(100)
2009-08-25 16:24:44 +02:00
{ }
2009-08-25 16:24:44 +02:00
static void addGlobalOptions( boost::program_options::options_description& general ,
boost::program_options::options_description& hidden );
/**
* @return true if should run program, false if should exit
*/
static bool store( int argc , char ** argv ,
boost::program_options::options_description& visible,
boost::program_options::options_description& hidden,
boost::program_options::positional_options_description& positional,
boost::program_options::variables_map &output );
2009-08-25 16:24:44 +02:00
};
2009-08-25 16:24:44 +02:00
extern CmdLine cmdLine;
void setupCoreSignals();
2009-08-25 16:24:44 +02:00
}