]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: Check and specify commands that require the pgid specification
authorDavid Zafman <dzafman@redhat.com>
Tue, 23 Jun 2015 02:16:22 +0000 (19:16 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 10 Jul 2015 17:10:43 +0000 (10:10 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/tools/ceph_objectstore_tool.cc

index 39d720c06571fbbb6d6eeb477f2815e729bbd79d..954af594e6cd09b5fd663ba96ac2e1a5da494781 100644 (file)
@@ -1831,7 +1831,7 @@ int main(int argc, char **argv)
     ("journal-path", po::value<string>(&jpath),
      "path to journal, mandatory for filestore type")
     ("pgid", po::value<string>(&pgidstr),
-     "PG id, mandatory except for import, fix-lost, list-pgs, set-allow-sharded-objects, dump-journal, dump-super")
+     "PG id, mandatory for info, log, remove, export, rm-past-intervals")
     ("op", po::value<string>(&op),
      "Arg is one of [info, log, remove, export, import, list, fix-lost, list-pgs, rm-past-intervals, set-allow-sharded-objects, dump-journal, dump-super]")
     ("file", po::value<string>(&file),
@@ -2190,14 +2190,10 @@ int main(int argc, char **argv)
     }
   }
 
-  // The ops which don't require --pgid option are checked here and
-  // mentioned in the usage for --pgid with some exceptions.
-  // The dump-journal op isn't here because it is handled earlier.
-  // The dump-journal-mount op is undocumented so not in the usage.
-  if (op != "list" && op != "import" && op != "fix-lost"
-      && op != "list-pgs"  && op != "set-allow-sharded-objects"
-      && op != "dump-journal-mount" && op != "dump-super"
-      && (pgidstr.length() == 0)) {
+  // The ops which require --pgid option are checked here and
+  // mentioned in the usage for --pgid.
+  if ((op == "info" || op == "log" || op == "remove" || op == "export"
+      || op == "rm-past-intervals") && pgidstr.length() == 0) {
     cerr << "Must provide pgid" << std::endl;
     usage(desc);
     ret = 1;