<< " import <path> [--force]\n"
<< " export <path>\n"
<< " reset [--force]\n"
- << " cephfs-journal-tool [options] header <get|set <field> <value>\n"
- << " <field>: [trimmed_pos|expire_pos|write_pos|pool_id]"
+ << " cephfs-journal-tool [options] header <get|set> <field> <value>\n"
+ << " <field>: [trimmed_pos|expire_pos|write_pos|pool_id]\n"
<< " cephfs-journal-tool [options] event <effect> <selector> <output> [special options]\n"
<< " <selector>:\n"
<< " --range=<start>..<end>\n"
<< " --rank=filesystem:mds-rank|all Journal rank (mandatory)\n"
<< " --journal=<mdlog|purge_queue> Journal type (purge_queue means\n"
<< " this journal is used to queue for purge operation,\n"
- << " default is mdlog, and only mdlog support event mode)\n"
+ << " default is mdlog, and only mdlog support event mode)\n"
<< "\n"
<< "Special options\n"
<< " --alternate-pool <name> Alternative metadata pool to target\n"
*/
int JournalTool::main_journal(std::vector<const char*> &argv)
{
+ if (argv.empty()) {
+ derr << "Missing journal command, please see help" << dendl;
+ return -EINVAL;
+ }
+
std::string command = argv[0];
if (command == "inspect") {
return journal_inspect();
ceph_assert(js.header != NULL);
}
- if (argv.size() == 0) {
- derr << "Invalid header command, must be [get|set]" << dendl;
+ if (argv.empty()) {
+ derr << "Missing header command, must be [get|set]" << dendl;
return -EINVAL;
}
std::vector<const char *>::iterator arg = argv.begin();
{
int r;
- std::vector<const char*>::iterator arg = argv.begin();
+ if (argv.empty()) {
+ derr << "Missing event command, please see help" << dendl;
+ return -EINVAL;
+ }
+ std::vector<const char*>::iterator arg = argv.begin();
std::string command = *(arg++);
if (command != "get" && command != "splice" && command != "recover_dentries") {
derr << "Unknown argument '" << command << "'" << dendl;