license

command module
Version: v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2020 License: MIT Imports: 15 Imported by: 0

README

license is a command line tool to create LICENSE files.

It provides good defaults for name and year on license (customizable if needed), and it supports all license types listed on the GitHub Licenses API. The license templates used by this program are copied from the GitHub Licenses API.

agpl-3.0      (GNU Affero General Public License v3.0)
apache-2.0    (Apache License 2.0)
bsd-2-clause  (BSD 2-Clause "Simplified" License)
bsd-3-clause  (BSD 3-Clause "New" or "Revised" License)
cc0-1.0       (Creative Commons Zero v1.0 Universal)
epl-2.0       (Eclipse Public License 2.0)
gpl-2.0       (GNU General Public License v2.0)
gpl-3.0       (GNU General Public License v3.0)
lgpl-2.1      (GNU Lesser General Public License v2.1)
lgpl-3.0      (GNU Lesser General Public License v3.0)
mit           (MIT License)
mpl-2.0       (Mozilla Public License 2.0)
unlicense     (The Unlicense)

Install

go get github.com/nishanths/license

Usage

Print license

To print a license to stdout, run the license command followed by the license name:

$ license mit
Save to file

Use the -o flag to save the license to a file, or use your shell's redirection operator:

$ license -o LICENSE.txt mit
$ license mit > LICENSE.txt
Customize name and year
$ license -year 2013 -name "Alice L" isc

The current year is used if -year is omitted.

To determine the name on the license, the following are used in this order:

- command line flags: -name, -n
- environment variable: LICENSE_FULL_NAME
- gitconfig and hgconfig
- "os/user".Current()
- empty string

If you have your name set in $HOME/.gitconfig, you can almost always omit the -name flag.

Demo

Contributing

Pull requests for new features, bug fixes, and suggestions are welcome!

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL