Next: notice invocation, Previous: png-apply invocation, Up: Writing boilerplate [Index]
prepend: Add arbitrary text to the start of a file
When the current working boilerplate that
licensing produces is insufficient in some way, the
prepend command provides more control. For example, some free software developers prefer to change the GNU GPL license notice to replace ‘This software’ with the name of their program. Others may have different tastes in commenting styles or indentation. The purpose of this command is to allow that kind of extra control.
prepend command is similar to the
apply command but instead of adding the current working boilerplate to the beginning of source code files, an arbitrary file can be added. A file can be prepended in two ways. The first way looks like this:
$ licensing prepend myfile.txt foo.c --no-backup
In the second way, the same input file can be added via the standard input.
$ cat myfile.txt | licensing prepend foo.c --no-backup
These two commands are equivalent. Both add myfile.txt to the beginning of foo.c, while not retaining the original foo.c file in a backup file.
When the destination file happens to be a script, the input file will appear after the ‘#!’ line.
To place the input file after any previously existing boilerplate in the source file, use the --after option. Specify a commenting-style with one of the common options (see Common Commenting-style options, or the previously existing boilerplate in the destination file is automatically detected.