1SRCREDACT(1)                      Text tools                      SRCREDACT(1)
2
3
4

NAME

6       srcredact - a program for redaction of text files
7

SYNOPSIS

9       srcredact [OPTIONS] -e audience [full_file]
10
11       srcredact [OPTIONS] -u audience full_file [redacted_file]
12
13       srcredact -l [full_file]
14
15       srcredact -h|-v
16

DESCRIPTION

18       srcredact is the program to extract ``redacted versions'' of the master
19       file (option -e) or to incorporate the changes in the redacted versions
20       into the master file (``unredact'', option -u).
21
22       The master file consists of chunks intended for different audiences.
23       Each audience has a name, e.g. "classified", "unclssified", "expert"
24       etc.  Chunks are started and stopped by guard lines.  Each guard line
25       has the format (for the default TeX syntax)
26
27         %<*name1|name2|...>
28
29       or
30
31         %</name1|name2|...>
32
33       In the first cases the text following the guard is included for the
34       audiences "name1", "name2", ....  In the second case it is excluded for
35       these audiences.
36
37       THere is a special audience "ALL": a wild card for all audiences.  Thus
38       the idiom
39
40         %</ALL>
41         %<*classified>
42
43       means that the chunk is excluded for all audiences but "classified"
44
45       Exactly one of the options  -e (extract) or -u (unextract) must be
46       present.  In  the extract mode the  non-option argument is  the name of
47       the full file.   If it is absent, or is "-",  standard input is used.
48       In the unextract mode the first non-option argument
49

OPTIONS

51       -c list of comment patterns
52           Use the given pattern for comment lines to search for guards
53           instead of the default "TeX" pattern.  The recognized patterns are:
54
55           c
56                 /*<guard>*/
57
58           cpp
59                 //<guard>
60
61           fortran
62                 C<guard>
63
64           shell
65                 #<guard>
66
67           TeX
68                 %<guard>
69
70           The pattern names should be separated by commas, and the list may
71           be enclosed in quotes to prevent shell expansion, e.g
72
73             -c "TeX, c, shell"
74
75       -d  Debug mode on.
76
77       -e audience
78           Extract the contents for the current audience into the file file.
79           The cuurent audience is guessed from the file name, if the latter
80           has the structure base-audience.extension, e.g.
81           "report-unclassified.tex".  The key -a overrides this guess and
82           should be used if the file name does not follow this pattern.  The
83           file name "-" means the standard output.
84
85       -h  Print help information and exit.
86
87       -l  List all audiences set in the file (one per line) and exit.
88
89       -u audience
90           Take a edited file intended for the audience (the second non-option
91           argument) and incorporate the changes in it into the full file (the
92           first non-option argument).  If the second argument is missing,
93           standard input is used instead.  As usual, "-" also means standard
94           input.  Note that only one of the two file arguments in this case
95           can be standard input.
96
97       -v  Print version information and exit.
98
99       -w on|off|1|0|true|false
100           If "on", 1 or "true" (the deafult), implicitly wrap the full
101           document into the guards
102
103            %<*ALL>
104            ...
105            %</ALL>
106

RETURN VALUE

108       The program returns 0 if successful, 1 if conflicts were found in the
109       "unextract" mode and 2 in case of problems.
110

CONFLICTS IN UNEXTRACT MODE

112       Like the standard diff3(1) tool, the program may find conflicts between
113       the full version and the edited one in the -u mode.  Then the resulting
114       file brackets the conflicts in the usual manner, e.g.
115
116         <<<<<<< /tmp/BrjXo0hMOB/full
117         %</nobonds>
118         Forty-five tons best old dry government bonds, suitable for furnace, gold
119         7 per cents., 1864, preferred.
120         %<*nobonds>
121         ||||||| /tmp/BrjXo0hMOB/extracted
122         Forty-five tons best old dry government bonds, suitable for furnace, gold
123         7 per cents., 1864, preferred.
124         =======
125         >>>>>>> /tmp/BrjXo0hMOB/new
126
127       Here "full" is the full document, "extracted" is the extracted file for
128       the given audience, "new" is the edited file.
129

AUTHOR

131       Boris Veytsman, borisv@lk.net
132
133       This work was commissioned by Consumer Financial Protection Bureau,
134       United States Treasury.
135
137       Copyright (C) 2015 Boris Veytsman.  Version 1.0
138
139       This program is free software; you can redistribute it and/or modify it
140       under the terms of the GNU General Public License as published by the
141       Free Software Foundation; either version 2 of the License, or (at your
142       option) any later version.
143
144       This program is distributed in the hope that it will be useful, but
145       WITHOUT ANY WARRANTY; without even the implied warranty of
146       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147       General Public License for more details.
148
149       You should have received a copy of the GNU General Public License along
150       with this program; if not, write to the Free Software Foundation, Inc.,
151       51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
152
153
154
1551.0                               2015-10-24                      SRCREDACT(1)
Impressum