Instead of a parsable array make it easier to cut and paste listed objects
Signed-off-by: David Zafman <dzafman@redhat.com>
}
void dump(Formatter *f) const {
- f->open_array_section("pgid_objects");
+ bool terminal = isatty(STDOUT_FILENO);
+ if (!terminal)
+ f->open_array_section("pgid_objects");
for (list<pair<coll_t, ghobject_t> >::const_iterator i = _objects.begin();
i != _objects.end();
i++) {
+ if (i != _objects.begin() && terminal) {
+ f->flush(cout);
+ cout << std::endl;
+ }
f->open_array_section("pgid_object");
i->first.dump(f);
f->open_object_section("ghobject");
f->close_section();
f->close_section();
}
- f->close_section();
+ if (!terminal)
+ f->close_section();
}
};