licensing: Licensing utility program.
licensing program has various commands. To run them, type:
$ licensing COMMAND
Some commands involve the concept of a current working boilerplate, and some do not. The current working boilerplate is a notional block of text representing the boilerplate that the user wants to add to a file. It lets the user easily change the commenting style, or copyright holders before applying a similar boilerplate to another kind of file.
There are commands for creating a current working boilerplate: (see Creating boilerplate)
Resets the current working boilerplate. Any previously selected licenses, commenting styles, or copyright holders are thrown out. See new-boilerplate invocation.
Adds or changes the license notice or commenting style for the current working boilerplate. See choose invocation.
Adds or removes a copyright notice to the current working boilerplate. See copyright invocation.
Add a beginning line to the current working boilerplate to describe what the file is for. See top invocation.
Adds a project-identifying line to the current working boilerplate. See project invocation.
Adds some extra text to the current working boilerplate See extra invocation.
The current working boilerplate can be subsequently written to files: (see Writing boilerplate)
Writes the current working boilerplate to source code files. See apply invocation.
Writes the current working boilerplate to .png image files. See png-apply invocation.
Creates and writes a simple boilerplate to a source code file. This command does not reference the current working boilerplate. See notice invocation.
Adds some arbitrary text to the start of a file. This command does not reference the current working boilerplate. See prepend invocation.
There are a few commands for showing boilerplate in files: (see Scanning for boilerplate)
Show the boilerplate in source code files. This command can also remove the boilerplate from a file. See boilerplate invocation.
Counts the number of distinct boilerplate blocks in source code files. See cbb invocation.
Show the comment in .png image files. This command can also remove the comment from a .png file. See png-boilerplate invocation.
There are commands that display licenses and their notices: (see License commands)
Shows various verisons of the GNU General Public License notice, or optionally the texts of the full license. See gpl invocation.
Shows various verisons of the GNU Lesser General Public License notice, or optionally the texts of the full licenses. See lgpl invocation.
Shows the GNU Affero General Public License notice, or optionally the texts of the full licenses. See agpl invocation.
Shows various versions of the GNU Free Documentation License notice, or optionally the text of the full licenses. See fdl invocation.
Shows the GNU All-Permissive license. See all-permissive invocation.
Shows various versions of the Berkeley Software Distribution license. See bsd invocation.
Shows the Apache license notice or optionally the full license text. See apache invocation.
Shows the Massachusetts Institute of Technology license. Also known as the X11 License. See mit invocation.
Shows the Internet Systems Consortium license. Also known as the OpenBSD License. See isc invocation.
There are commands that operate on commenting styles: (see Working with comments)
Creates a comment block in a commenting style particular to a programming language. See comment invocation.
Removes comment delimiters from some text in a file. See uncomment invocation.
And finally there are are a few commands that are informational in nature (see Informational commands that display various bits of information:
Shows the current working boilerplate. See preview invocation.
Shows the welcome message. See welcome invocation.
Shows the warranty message. See warranty invocation.
Shows help on all of these commands. See help invocation.
When a command is not given as an argument to
licensing, the interactive
lush shell is started. The --quiet option prevents the welcome message from being displayed in the lush shell.
The lush shell is an extended bash shell. The initialization file for lush is automatically generated, and lives in ~/.lushrc.
The program state (e.g. the current working boilerplate) is kept in ~/.licensutils/.
All of the
licensing commands work in the lush shell without a
licensing command prefixed to it.
#!/usr/bin/env lush welcome exit 0
This lush script is equivalent to running the command:
licensing welcome. Although this example shows a lush script, the shell is most often used interactively.