[era_dump] add --logical

This commit is contained in:
Joe Thornber
2014-02-14 14:35:25 +00:00
parent 54f38e6702
commit 49e59ca781
3 changed files with 106 additions and 20 deletions

View File

@@ -19,10 +19,12 @@ using namespace std;
namespace {
struct flags {
flags()
: repair_(false) {
: repair_(false),
logical_(false) {
}
bool repair_;
bool logical_;
};
//--------------------------------
@@ -40,11 +42,11 @@ namespace {
if (want_stdout(output)) {
emitter::ptr e = create_xml_emitter(cout);
metadata_dump(md, e, fs.repair_);
metadata_dump(md, e, fs.repair_, fs.logical_);
} else {
ofstream out(output.c_str());
emitter::ptr e = create_xml_emitter(out);
metadata_dump(md, e, fs.repair_);
metadata_dump(md, e, fs.repair_, fs.logical_);
}
} catch (std::exception &e) {
@@ -61,7 +63,8 @@ namespace {
<< " {-h|--help}" << endl
<< " {-o <xml file>}" << endl
<< " {-V|--version}" << endl
<< " {--repair}" << endl;
<< " {--repair}" << endl
<< " {--logical}" << endl;
}
}
@@ -79,6 +82,7 @@ int main(int argc, char **argv)
{ "output", required_argument, NULL, 'o' },
{ "version", no_argument, NULL, 'V' },
{ "repair", no_argument, NULL, 1 },
{ "logical", no_argument, NULL, 2 },
{ NULL, no_argument, NULL, 0 }
};
@@ -88,6 +92,10 @@ int main(int argc, char **argv)
fs.repair_ = true;
break;
case 2:
fs.logical_ = true;
break;
case 'h':
usage(cout, basename(argv[0]));
return 0;