]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephtool: multiword admin socket commands
authorSage Weil <sage@inktank.com>
Fri, 18 May 2012 00:30:35 +0000 (17:30 -0700)
committerSage Weil <sage@inktank.com>
Fri, 18 May 2012 23:23:58 +0000 (16:23 -0700)
Slurp up anything on the command line that isn't an option, so that you can
do

 ceph --admin-socket /path/to/asok foo bar baz

instead of

 ceph --admin-socket /path/to/asok 'foo bar baz'

Signed-off-by: Sage Weil <sage@inktank.com>
src/tools/ceph.cc

index 5da84792fce498d9d7dffb21998ee31645b8d466..8e824c79de7aef95bc74c15a4886abfc474ab50c 100644 (file)
@@ -76,7 +76,7 @@ static void parse_cmd_args(vector<const char*> &args,
       *admin_socket = val;
       if (i == args.end())
        usage();
-      *admin_socket_cmd = *i;
+      *admin_socket_cmd = *i++;
     } else if (ceph_argparse_flag(args, i, "-s", "--status", (char*)NULL)) {
       *mode = CEPH_TOOL_MODE_STATUS;
     } else if (ceph_argparse_flag(args, i, "-w", "--watch", (char*)NULL)) {
@@ -98,6 +98,9 @@ static void parse_cmd_args(vector<const char*> &args,
     } else if (ceph_argparse_flag(args, i, "-h", "--help", (char*)NULL)) {
       usage();
     } else {
+      if (admin_socket_cmd && admin_socket_cmd->length()) {
+       *admin_socket_cmd += " " + string(*i);
+      }
       ++i;
     }
   }