Next: , Previous: , Up: Creating boilerplate   [Index]


3.3 copyright: Add a copyright notice to the boilerplate

The copyright command adds or removes copyright notices to or from the current working boilerplate. When the copyright command is called without any arguments, the copyright notices in the current working boilerplate are displayed.

The command is most commonly used to add copyright holders in this way:

$ licensing copyright Yoyodyne, Inc. 2001
Copyright (C) 2001 Yoyodyne, Inc.
Added.

Years can be given in a comma-separated list, and with a range separated by a hyphen. For example:

$ licensing copyright Yoyodyne, Inc. 2001,2003-2005
Copyright (C) 2001, 2003, 2004, 2005 Yoyodyne, Inc.
Added.

When the years happen to be supplied with an incorrect ordering, (e.g. 2003 before 2001) the copyright command will sort them properly. When a year is not supplied, the current year will be shown.

The --abbreviate-years option (-a) will abbreviate the years as expected:

$ licensing copyright Yoyodyne, Inc. 2001,2003-2005 -a
Copyright (C) 2001, 2003-2005 Yoyodyne, Inc.
Added.

More than one copyright holder can be specified in a single call to copyright by passing the names through the standard input, like so:

cat << EOF | licensing copyright 2001-8 -a
Yoyodyne, Inc.
Thomas Pynchon
EOF 
Copyright (C) 2001-2008 Yoyodyne, Inc., Thomas Pynchon
Added.

This example separates multiple copyright holders by commas. Also notice the way that ‘2001-2008’ is originally given as ‘2001-8’.

The --one-per-line option dispenses with the commas and shows a single copyright holder per line. For example:

cat << EOF | licensing copyright 2001-8 -a --one-per-line
Yoyodyne, Inc.
Thomas Pynchon
EOF 
Copyright (C) 2001-2008 Yoyodyne, Inc.
Copyright (C) 2001-2008 Thomas Pynchon
Added.

When the names of copyright holders can’t all fit on the same 80 character line, they are moved to the following line like so:

cat << EOF | licensing copyright 2001-8 
Yoyodyne, Inc.
Thomas Pynchon
EOF 
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Yoyodyne, Inc.
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Thomas Pynchon
Added.

The --quiet option will prevent the ‘Added.’ message and the copyright notices in the current working boilerplate from being displayed.

There are two options for controlling the appearance of the ‘(C)’. The --small-c option will display ‘(c)’ instead, while the --unicode-sign option will display ‘©’ instead.

The --dry-run option simply shows the new copyright line without changing the current working boilerplate.

When the names of copyright holders have numbers in their names that look like years, the --year (-y) option can be used. Using this option will cause the numbers in the arguments to be treated as a name.

Long lines can sometimes be created by the copyright command.

3.3.1 Subsequent calls of the copyright command

Subsequent calls of the copyright command will add more copyright holders to the current working boilerplate. New copyright holders appear after any previously added copyright holders.

When one copyright holder has already been specified and another is added, the copyright command will subsequently display two lines, not one. One line is displayed for each copyright holder.

3.3.2 Removing copyright notices

Recall that to show the copyright holders in the current working boilerplate, the copyright command is called without any arguments:

$ licensing copyright
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Yoyodyne, Inc.
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Thomas Pynchon

To remove the second copyright holder (Thomas Pynchon), use the --remove option:

$ licensing copyright --remove=1
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Yoyodyne, Inc.
Removed.

The argument to the --remove option starts counting at 0, so the second line is referenced by the number 1.


Next: , Previous: , Up: Creating boilerplate   [Index]