From: Sage Weil Date: Fri, 8 Jun 2012 19:45:42 +0000 (-0700) Subject: ceph_argparse: make entityname parsing error more helpful X-Git-Tag: v0.48argonaut~74^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4ec4b4774da4150d27eaac6f8fe86b470c95bc65;p=ceph.git ceph_argparse: make entityname parsing error more helpful Signed-off-by: Sage Weil --- diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 60581005c23f..a6ef1d31a229 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 e7fdc17856ef..d0fe553ed007 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 756a6bb8a985..42647520b6f5 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]