// // See the file LICENSE for redistribution information. // // Copyright (c) 2002,2009 Oracle. All rights reserved. // // #include #include #include #include "DefaultShell.hpp" #include "dbxml/DbXml.hpp" #include "Environment.hpp" #include "common_utils.h" #ifdef HAVE_GETOPT #include #else extern "C" int getopt(int argc, char * const argv[], const char *optstring); extern "C" char *optarg; extern "C" int optind; #endif using namespace DbXml; using namespace std; bool verboseErrors = false; static void errcall(const DB_ENV *dbenv, const char *errpfx, const char *msg) { if (verboseErrors) { if(errpfx) { cerr << errpfx << ": "; } cerr << msg << endl; } } static void usage(const string &progname, int exitCode) { string::size_type pos = progname.rfind('/'); if(pos == string::npos) { pos = progname.rfind('\\'); } if(pos == string::npos) { pos = 0; } else { ++pos; } cerr << "Usage: " << progname.substr(pos) << " [OPTIONS]" << endl << endl; cerr << "Options:" << endl; cerr << "-c\t\tcreate a new environment in the directory specified by the -h option." << endl; cerr << "-h \tuse specified directory as a Berkeley DB environment. (default: .)" << endl; cerr << "-P \tspecify database password" << endl; cerr << "-s