]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monmaptool: implement --help
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 14 Jun 2011 21:47:03 +0000 (14:47 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 14 Jun 2011 21:47:03 +0000 (14:47 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/monmaptool.cc
src/test/cli/monmaptool/help.t

index e5debd4b543fba98f151dcf7e43904c80cddb698..2382e5831b8a203dc0b44ee8c770dac127d4e9e2 100644 (file)
@@ -53,7 +53,9 @@ int main(int argc, const char **argv)
              CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
   common_init_finish(&g_ceph_context);
   FOR_EACH_ARG(args) {
-    if (CEPH_ARGPARSE_EQ("print", '\0')) {
+    if (CEPH_ARGPARSE_EQ("help", '\0')) {
+      usage();
+    } else if (CEPH_ARGPARSE_EQ("print", '\0')) {
       CEPH_ARGPARSE_SET_ARG_VAL(&print, OPT_BOOL);
     } else if (CEPH_ARGPARSE_EQ("create", '\0')) {
       CEPH_ARGPARSE_SET_ARG_VAL(&create, OPT_BOOL);
index fad1c657bcbd523234db35e781a32e90e558dda7..f39cff4e2f9242ef444b1d9ba2f229388fa60411 100644 (file)
@@ -1,6 +1,3 @@
-# TODO be user-friendly
   $ monmaptool --help
-  monmaptool: monmap file --help
-  \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ [0-9a-f]{8,} can't open --help: error 2: No such file or directory (re)
-  monmaptool: couldn't open --help: No such file or directory
-  [255]
+   usage: [--print] [--create [--clobber]] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
+  [1]