From: Colin Patrick McCabe Date: Tue, 14 Jun 2011 21:47:03 +0000 (-0700) Subject: monmaptool: implement --help X-Git-Tag: v0.30~46 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eced4d6bb60e5eb546a9498ba3f49fe00a185d61;p=ceph.git monmaptool: implement --help Signed-off-by: Colin McCabe --- diff --git a/src/monmaptool.cc b/src/monmaptool.cc index e5debd4b543f..2382e5831b8a 100644 --- a/src/monmaptool.cc +++ b/src/monmaptool.cc @@ -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); diff --git a/src/test/cli/monmaptool/help.t b/src/test/cli/monmaptool/help.t index fad1c657bcbd..f39cff4e2f92 100644 --- a/src/test/cli/monmaptool/help.t +++ b/src/test/cli/monmaptool/help.t @@ -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] + [1]