0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

restore: use default arg instead of positional for dump directory. check for valid directory before drilling down

This commit is contained in:
Mike Dirolf 2009-09-15 13:26:08 -04:00
parent b754cb2808
commit adeafb1d49

View File

@ -33,14 +33,18 @@ class Restore : public Tool {
public:
Restore() : Tool( "restore" ){
add_options()
("dir",po::value<string>() , "directory to restore from" )
("dir", po::value<string>()->default_value("dump"), "directory to restore from")
;
addPositionArg( "dir" , 1 );
}
int run(){
auth();
drillDown( getParam( "dir" ) );
path root = getParam("dir");
if (!is_directory(root)) {
cerr << "\"" << root.string() << "\" is not a valid directory" << endl;
return EXIT_BADOPTIONS;
}
drillDown(root);
return 0;
}