]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Allow dashes in ceph_argparse, etc.
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 9 May 2011 23:18:48 +0000 (16:18 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 10 May 2011 18:16:21 +0000 (11:16 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/common/ceph_argparse.cc

index c6f7cdcd9dcc7ab64ccfaf258864d39821765129..a74b80ed62229dffc18bf0a741474d1c2441a242 100644 (file)
@@ -277,7 +277,9 @@ bool ceph_argparse_flag(std::vector<const char*> &args,
     a = va_arg(ap, char*);
     if (a == NULL)
       return false;
-    if (strcmp(a, first) == 0) {
+    char a2[strlen(a)+1];
+    dashes_to_underscores(a, a2);
+    if (strcmp(a2, first) == 0) {
       i = args.erase(i);
       return true;
     }