From 53269374b38d9e1671565883d5add738b67bd268 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 22 May 2012 13:53:11 -0700 Subject: [PATCH] config: add --show-args option The --show-args dumps the arguments passed on the command line. Signed-off-by: Yehuda Sadeh --- src/common/ceph_argparse.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 75b413d60edaa..22343271e5e6c 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -343,6 +343,9 @@ CephInitParameters ceph_argparse_early_args { CephInitParameters iparams(module_type); std::string val; + + vector orig_args = args; + for (std::vector::iterator i = args.begin(); i != args.end(); ) { if (strcmp(*i, "--") == 0) { /* Normally we would use ceph_argparse_double_dash. However, in this @@ -375,6 +378,15 @@ CephInitParameters ceph_argparse_early_args _exit(1); } } + else if (ceph_argparse_flag(args, i, "--show_args", (char*)NULL)) { + cout << "args: "; + for (std::vector::iterator ci = orig_args.begin(); ci != orig_args.end(); ++ci) { + if (ci != orig_args.begin()) + cout << " "; + cout << *ci; + } + cout << std::endl; + } else { // ignore ++i; -- 2.39.5