diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-03-30 10:15:35 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-03-30 10:16:20 +0300 |
commit | 488db18a722fbf80cd4f76af6a82891293551f84 (patch) | |
tree | 1d6a6b23f30b48524bd872726a96b739d8f4308d | |
parent | 0f73c9f19e332161c7b760dfb39f954e9ff219d1 (diff) | |
download | cfpeek-488db18a722fbf80cd4f76af6a82891293551f84.tar.gz cfpeek-488db18a722fbf80cd4f76af6a82891293551f84.tar.bz2 |
Version 1.1release-1.1
Update docs.
-rw-r--r-- | NEWS | 16 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | doc/cfpeek.1 | 55 | ||||
-rw-r--r-- | doc/cfpeek.texi | 2 | ||||
-rw-r--r-- | src/cmdline.opt | 4 |
5 files changed, 54 insertions, 25 deletions
@@ -1,11 +1,11 @@ -Cfpeek NEWS -- history of user-visible changes. 2011-05-31 -Copyright (C) 2011 Sergey Poznyakoff +Cfpeek NEWS -- history of user-visible changes. 2012-03-30 +Copyright (C) 2011, 2012 Sergey Poznyakoff See the end of file for copying conditions. Please send cfpeek bug reports to <bug-cfpeek@gnu.org.ua> -Version 1.0.90 (Git) +Version 1.1, 2012-03-30 * New command line option --init (-i) @@ -15,7 +15,7 @@ Version 1.0.90 (Git) - (grecs-node-ident-locus node [full]) -Returns the location of the node's ident. See below for the meaning +Returns the location of the node's identifier. See below for the meaning of [full]. - (grecs-node-value-locus node [full]) @@ -29,7 +29,7 @@ simplified location consists of a file name and line number. When returned from a Guile primitive, they are packed in a cons. A simplified location shows an approximate location of the object in the configuration file. -A full location provides an exact location of the object. It consists of +A full location provides the exact location of the object. It consists of a pair of triplets, which mark the beginning and end of the object. Each triplet consists of a file name, line number and column number. When returned from a Guile primitive, each triplet is represented as a list of @@ -38,8 +38,8 @@ being its car, and the end location being its cdr. The three functions that return node locations, grecs-node-locus, grecs-node-ident-locus and grecs-node-value-locus, return simplified -locations by default. If the optional second argument is supplied and -is #t, these functions return full locations. +locations by default. If #t is supplied as the optional second +argument, these functions return full locations. @@ -51,7 +51,7 @@ Initial revision ========================================================================= Copyright information: -Copyright (C) 2011 Sergey Poznyakoff +Copyright (C) 2011, 2012 Sergey Poznyakoff Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the diff --git a/configure.ac b/configure.ac index 17edec6..c915f92 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ # along with cfpeek. If not, see <http://www.gnu.org/licenses/>. AC_PREREQ(2.63) -AC_INIT([cfpeek], 1.0.90, [bug-cfpeek@gnu.org.ua]) +AC_INIT([cfpeek], 1.1, [bug-cfpeek@gnu.org.ua]) AC_CONFIG_SRCDIR([src/cfpeek.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADER([config.h]) diff --git a/doc/cfpeek.1 b/doc/cfpeek.1 index 088774b..c1e5a9e 100644 --- a/doc/cfpeek.1 +++ b/doc/cfpeek.1 @@ -14,7 +14,7 @@ .\" You should have received a copy of the GNU General Public License .\" along with cfpeek. If not, see <http://www.gnu.org/licenses/>. .\" -.TH CFPEEK 1 "May 26, 2011" "CFPEEK" "Cfpeek User Reference" +.TH CFPEEK 1 "March 30, 2012" "CFPEEK" "Cfpeek User Reference" .SH NAME cfpeek \- retrieve values from a structured configuration file .SH SYNOPSIS @@ -292,9 +292,22 @@ one or more of the following: \fBparent\fR=\fINAME\fR Search for a parent node with the given \fINAME\fR and print it. .TP +\fBchild\fR=\fINAME\fR +Locate a child of the current node which has the identifier \fINAME\fR +and print it. +.TP +\fBsibling\fR=\fINAME\fR +Find in the current node the first sibling identified by \fINAME\fR. +See the example \fB7\fR in the +.B EXAMPLES +section below. +.TP \fBup\fR=\fIN\fR Print \fIN\fRth parent node. .TP +\fBdown\fR=\fIN\fR +Print the node located \fIN\fR levels of hierarchy below the current one. +.TP \fBdelim\fR=\fICHAR\fR Use \fICHAR\fR as path component delimiter, instead of the default dot. .PP @@ -406,6 +419,11 @@ for a detailed description. If both \fB\-\-file\fR and \fB\-\-expression\fR are given, the file is loaded first, and expression is applied to each node. .TP +\fB\-i\fR, \fB\-\-init=\fIEXPR\fR +This option provides an initialization expression, which is evaluated +once, after loading the script file, if one is specified, and before +starting the main loop. +.TP \fB\-l\fR, \fB\-\-lang\fR=\fINAME\fR Select scripting language to use. This is reserved for future use. .SS Preprocessor control @@ -504,7 +522,7 @@ as it will not be called implicitly, but it may do so, if this function is called from the expression. .PP These options are often used together to supply additional information -to the script file. See the example \fB9\fR in the +to the script file. See the example \fB10\fR in the .B EXAMPLES section below. .SS Node functions @@ -700,21 +718,21 @@ required by .SH EXAMPLES .SS 1. -The following prints the entire contents of the +Print the entire contents of the .BR /etc/dico.conf : .P .nf .B $ cfpeek /etc/dico.conf .fi .SS 2. -The following prints the contents of +Print contents of .BR /etc/named.conf : .P .nf .B $ cfpeek --parser=bind /etc/named.conf .fi .SS 3. -This will print the value of the \fBpid-file\fR keyword from the +Print the value of the \fBpid-file\fR keyword from the \fBoptions\fR section of .BR /etc/named.conf : .P @@ -736,8 +754,8 @@ option: .B $ cfpeek --parser=bind --format=value /etc/named.conf .options.pid-file .fi .SS 4. -Use of the above in a startup/shutdown script to bring \fBnamed\fR -down: +This is how to use the above in a startup/shutdown script to bring +\fBnamed\fR down: .P .in +5 .nf @@ -751,10 +769,10 @@ fi .in .SS 5. Find and print every occurrence of \fBfacility\fR keyword in -.BR /etc/mailutils.rc : +.BR /etc/mailutils.rc (note the quotes): .P .nf -.B $ cfpeek /etc/mailutils.rc .*.facility +.B $ cfpeek /etc/mailutils.rc '.*.facility' .fi .SS 6. The same, but print only the locations where the keyword occurred: @@ -763,6 +781,17 @@ The same, but print only the locations where the keyword occurred: .B $ cfpeek --format=locus /etc/mailutils.rc .*.facility .fi .SS 7. +Find the names of zone files for all master nodes in +the \fBnamed.conf\fR file: +.P +.nf +.B $ cfpeek --parser bind --format=sibling=file,value /etc/named.conf \\\\ +.ti +2 +.B '.*.zone.type=master' +.fi +.P +See example \fB11\fR below, for another way of doing so. +.SS 8. Apply the script \fBmaster-zone.scm\fR to each statement from the file .BR /etc/named.conf: .P @@ -771,7 +800,7 @@ Apply the script \fBmaster-zone.scm\fR to each statement from the file .fi .P Notice the final dot, which refers to the root of the parse tree. -.SS 8. +.SS 9. Apply the script \fBmaster-zone.scm\fR to each \fBzone\fR statement which occurs within the \fBview \(dqexternal\(dq\fR section: .P @@ -780,19 +809,19 @@ which occurs within the \fBview \(dqexternal\(dq\fR section: .ti +2 .B .view=external.zone .fi -.SS 9. +.SS 10. Same as above, but initialize additional parameters for the script: .P .nf .B $ cfpeek --parser=bind --script=master-zone.scm \\\\ .ti +2 ---expression '(set! indent 8) (cfpeek node)' /etc/named.conf +.B --expression '(set! indent 8) (cfpeek node)' /etc/named.conf .ti +2 .B .view=external.zone .fi .P Note the explicit call to \fBcfpeek\fR function. -.SS 10. +.SS 11. Print the file name of each master zone in the .B /etc/named.conf file: diff --git a/doc/cfpeek.texi b/doc/cfpeek.texi index 0b28722..a29fbef 100644 --- a/doc/cfpeek.texi +++ b/doc/cfpeek.texi @@ -548,7 +548,7 @@ identifier @var{id}. @kwindex sibling Similarly, the @code{sibling} keyword instructs @command{cfpeek} to find first sibling of the current node wich has the given identifier. -For example, to find names of the zone files for all master nodes in +For example, to find the names of zone files for all master nodes in the @file{named.conf} file: @example diff --git a/src/cmdline.opt b/src/cmdline.opt index 79db92a..941c20f 100644 --- a/src/cmdline.opt +++ b/src/cmdline.opt @@ -1,5 +1,5 @@ /* This file is part of cfpeek -*- c -*- - Copyright (C) 2011 Sergey Poznyakoff + Copyright (C) 2011, 2012 Sergey Poznyakoff Cfpeek is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -190,7 +190,7 @@ OPTIONS_BEGIN("cfpeek", [<Get variables from a configuration file>], [<FILE [PATH...]>], [<gnu>], - [<copyright_year=2011>], + [<copyright_year=2011,2012>], [<copyright_holder=Sergey Poznyakoff>]) GROUP(Output control) |