Home| base |src.bin|build| addtext Index

addtext

Syntax
addtext --help
addtext -r string [-t tag]
addtext [-t tag] name
Synopsis
Insert a block of text or string into a text file.
Options
--helpprint the help message and exit.
-r stringreplacement text string to insert in the document.
-t tagtag string to match in the document. The default tag is 'License'.
nametext file to read replacement text from.
Description

Inserts a block of text or string, such as Copyright or License terms, within a section of source code. The source code is read from standard input and RCS style tags of the form "$tag$" are searched for. The default tag string is "License" but this can be overridden on the command line with the -t option.

When a tag is encountered, the text contained in the text file is substituted. As with the RCS utilities, each inserted line is prefixed by the characters that prefix the line that contains the tag:

// $license$

Becomes:

// Terms and Conditions
// The use of this program is subject to the terms and conditions
// described in the license agreement.

As with the RCS utilities, if the tag line is prefixed by "/*", subsequent lines are prefixed with "*".

The modified source code is written to standard output.

Examples
cat src/main.c | addtext license.txt > main.c

Add the text contained in the file license.txt to the file src/main.c.