From 4ec4b4774da4150d27eaac6f8fe86b470c95bc65 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 8 Jun 2012 12:45:42 -0700 Subject: [PATCH] ceph_argparse: make entityname parsing error more helpful Signed-off-by: Sage Weil --- src/common/ceph_argparse.cc | 6 +++--- src/test/cli/ceph-conf/invalid-args.t | 2 +- src/test/cli/ceph/name.t | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 60581005c23f2..a6ef1d31a2294 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -397,9 +397,9 @@ CephInitParameters ceph_argparse_early_args } else if (ceph_argparse_witharg(args, i, &val, "--name", "-n", (char*)NULL)) { if (!iparams.name.from_str(val)) { - cerr << "You must pass a string of the form TYPE.ID to " - << "the --name option. Valid types are: " - << EntityName::get_valid_types_as_str() << std::endl; + cerr << "error parsing '" << val << "': expected string of the form TYPE.ID, " + << "valid types are: " << EntityName::get_valid_types_as_str() + << std::endl; _exit(1); } } diff --git a/src/test/cli/ceph-conf/invalid-args.t b/src/test/cli/ceph-conf/invalid-args.t index e7fdc17856ef5..d0fe553ed0077 100644 --- a/src/test/cli/ceph-conf/invalid-args.t +++ b/src/test/cli/ceph-conf/invalid-args.t @@ -8,7 +8,7 @@ [1] $ ceph-conf -c test.conf --name total.garbage - You must pass a string of the form TYPE.ID to the --name option. Valid types are: auth, mon, osd, mds, client + error parsing 'total.garbage': expected string of the form TYPE.ID, valid types are: auth, mon, osd, mds, client [1] $ ceph-conf -c test.conf -s bar diff --git a/src/test/cli/ceph/name.t b/src/test/cli/ceph/name.t index 756a6bb8a985f..42647520b6f53 100644 --- a/src/test/cli/ceph/name.t +++ b/src/test/cli/ceph/name.t @@ -1,3 +1,3 @@ $ ceph --name=foo - You must pass a string of the form TYPE.ID to the --name option. Valid types are: auth, mon, osd, mds, client + error parsing 'foo': expected string of the form TYPE.ID, valid types are: auth, mon, osd, mds, client [1] -- 2.39.5