]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_argparse: make entityname parsing error more helpful
authorSage Weil <sage@inktank.com>
Fri, 8 Jun 2012 19:45:42 +0000 (12:45 -0700)
committerSage Weil <sage@inktank.com>
Tue, 12 Jun 2012 18:50:55 +0000 (11:50 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/common/ceph_argparse.cc
src/test/cli/ceph-conf/invalid-args.t
src/test/cli/ceph/name.t

index 60581005c23f270571f931163d457eb19d369335..a6ef1d31a22944a8ce66fa6ba551e733dd087dd5 100644 (file)
@@ -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);
       }
     }
index e7fdc17856ef54917a6f1711784daee0d803f436..d0fe553ed00771c18cef37398e6175fd75f6206d 100644 (file)
@@ -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
index 756a6bb8a985ff267361f5de3990f9986a90f4fb..42647520b6f536b8c3a37cdc383abd6d1752d940 100644 (file)
@@ -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]