]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
global: output usage on -h, --help, or no args before contacting mons
authorSage Weil <sage@redhat.com>
Thu, 8 Mar 2018 22:36:57 +0000 (16:36 -0600)
committerSage Weil <sage@redhat.com>
Thu, 15 Mar 2018 20:51:55 +0000 (15:51 -0500)
commit6972273d53dc2fcbe9c65d70a4e0f2af6270194e
tree418ef0c29a4d89bf91c31ad05cd2221e5fee1441
parentd71f70203f9a59c9465fef2874da1b69c39f6e91
global: output usage on -h, --help, or no args before contacting mons

- when there are no arguments, print a short invitation to stderr to
  use -h or --help and exit with an error.
- if we get -h or --help, print usage to stdout, and exit with success.
- do the above *before* making any contact with the cluster.  we should
  not fail to explain usage because the mons are down.
- if there is some other error with the arguments, print an error message,
  but do not spam the user with usage.  Try to use cerr instead of derr.

Signed-off-by: Sage Weil <sage@redhat.com>
41 files changed:
src/ceph_fuse.cc
src/ceph_mds.cc
src/ceph_mgr.cc
src/ceph_mon.cc
src/ceph_osd.cc
src/common/ceph_argparse.cc
src/common/ceph_argparse.h
src/librados-config.cc
src/rbd_replay/rbd-replay.cc
src/rgw/rgw_admin.cc
src/rgw/rgw_main.cc
src/rgw/rgw_object_expirer.cc
src/rgw/rgw_token.cc
src/test/TestSignalHandlers.cc
src/test/cli/ceph-authtool/help.t
src/test/cli/ceph-authtool/manpage.t
src/test/cli/ceph-authtool/simple.t
src/test/cli/ceph-kvstore-tool/help.t
src/test/cli/monmaptool/simple.t
src/test/cli/osdmaptool/missing-argument.t
src/test/cli/radosgw-admin/help.t
src/test/objectstore_bench.cc
src/test/rbd_mirror/random_write.cc
src/test/xattr_bench.cc
src/tools/ceph-client-debug.cc
src/tools/ceph_authtool.cc
src/tools/ceph_kvstore_tool.cc
src/tools/ceph_osdomap_tool.cc
src/tools/cephfs/DataScan.cc
src/tools/cephfs/JournalTool.cc
src/tools/cephfs/TableTool.cc
src/tools/cephfs/cephfs-data-scan.cc
src/tools/cephfs/cephfs-journal-tool.cc
src/tools/cephfs/cephfs-table-tool.cc
src/tools/crushtool.cc
src/tools/monmaptool.cc
src/tools/osdmaptool.cc
src/tools/rados/rados.cc
src/tools/rbd_ggate/main.cc
src/tools/rbd_mirror/main.cc
src/tools/rbd_nbd/rbd-nbd.cc