]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
man: cconf
authorSage Weil <sage@newdream.net>
Wed, 11 Mar 2009 03:49:30 +0000 (20:49 -0700)
committerSage Weil <sage@newdream.net>
Wed, 11 Mar 2009 03:49:30 +0000 (20:49 -0700)
debian/ceph.install
man/Makefile.am
man/cconf.8 [new file with mode: 0644]
src/cconf.cc

index bafceac02a67c2de9c96a7fc1e629dd8082ae691..e4eb101b81d6fc118d2ed02d995cfdab8b2b76b0 100644 (file)
@@ -23,3 +23,4 @@ usr/share/man/man8/crun.8
 usr/share/man/man8/csyn.8
 usr/share/man/man8/crushtool.8
 usr/share/man/man8/osdmaptool.8
+usr/share/man/man8/cconf.8
index ed0b54d995f1452438da41aefdaaf4f694571548..1ec5a27815c7457c710e77c5b221ca9bbaa4b300 100644 (file)
@@ -1,4 +1,4 @@
 AUTOMAKE_OPTIONS = gnu
 
-man_MANS = cosd.8 cmds.8 cmon.8 mkcephfs.8 cfuse.8 csyn.8 crushtool.8 osdmaptool.8
-dist_man_MANS = cosd.8 cmds.8 cmon.8 mkcephfs.8 cfuse.8 csyn.8 crushtool.8 osdmaptool.8
\ No newline at end of file
+man_MANS = cosd.8 cmds.8 cmon.8 mkcephfs.8 cfuse.8 csyn.8 crushtool.8 osdmaptool.8 cconf.8
+dist_man_MANS = cosd.8 cmds.8 cmon.8 mkcephfs.8 cfuse.8 csyn.8 crushtool.8 osdmaptool.8 cconf.8
\ No newline at end of file
diff --git a/man/cconf.8 b/man/cconf.8
new file mode 100644 (file)
index 0000000..eeefb59
--- /dev/null
@@ -0,0 +1,33 @@
+.TH CCONF 8
+.SH NAME
+cconf \- ceph conf file tool
+.SH SYNOPSIS
+.B cconf
+\fB\-c \fIconffile\fR
+( \fB\-l \fIprefix\fR | \fIkey\fR [ \fIdefault\fR ] \fB\-s \fIsection\fR [ \fB\-s \fIsection2\fP ... ] )
+.SH DESCRIPTION
+.B cconf
+is a utility for extracting values from a "INI" style configuration files.  It has
+two basic modes of operation.
+.PP
+The first mode simply prints all section names that begin with \fIprefix\fP.
+.PP
+The second mode extracts an option value by searching through one or more \fIsection\fPs,
+in the order specified on the command line.  If the option does not exist in
+\fIconffile\fP, an optional \fIdefault\fP value may be output instead.
+.SH EXAMPLES
+To extract the value of the "osd data" option from section \fI[osd0]\fP,
+\fI[osd]\fP, or \fI[global]\fP, in that order of preference:
+.IP
+cconf -c foo.conf "osd data" -s osd0 -s osd -s global
+.PP
+To list all sections that begin with \fIosd\fP:
+.IP
+cconf -c foo.conf -l osd
+.SH AVAILABILITY
+.B cconf
+is part of the Ceph distributed file system.  Please refer to the Ceph wiki at
+http://ceph.newdream.net/wiki for more information.
+.SH SEE ALSO
+.BR ceph (8),
+.BR mkcephfs (8)
index b19118db28a6b72ae0d16c4129ab314e338ee914..3a3afa087e81ee18d3190b368ace7b9bfb879f7c 100644 (file)
@@ -14,7 +14,7 @@ using namespace std;
 
 void usage() 
 {
-  cerr << "usage: cconf [--conf_file filename] [-l|--list_sections prefix] [-s <section>] [[-s section] ... ] <key> [default]" << std::endl;
+  cerr << "usage: cconf [-c filename] [-l|--list_sections <prefix>] [-s <section>] [[-s section] ... ] <key> [default]" << std::endl;
   exit(1);
 }
 
@@ -34,8 +34,7 @@ int main(int argc, const char **argv)
     usage();
 
   for (unsigned i=0; i<args.size(); i++) {
-    if (strcmp(args[i], "--conf_file") == 0 ||
-       strcmp(args[i], "-c") == 0) {
+    if (strcmp(args[i], "-c") == 0) {
       if (i < args.size() - 1)
         fname = args[++i];
       else