From 357910c559513fc0bc091611f582bd8e5bebc794 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Mon, 9 May 2011 16:18:48 -0700 Subject: [PATCH] Allow dashes in ceph_argparse, etc. Signed-off-by: Colin McCabe --- src/common/ceph_argparse.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index c6f7cdcd9dcc7..a74b80ed62229 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -277,7 +277,9 @@ bool ceph_argparse_flag(std::vector &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; } -- 2.39.5