licensegen

command module
v0.0.0-...-c26ad78 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2015 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

licensegen


licensegen is a small utility for both linux and windows that generates a LICENSE file for new open source projects. It comes with templates for several of the most popular OSS licenses.

licensegen generates both a LICENSE file containing the text of the selected OSS license and a file containing a comment header for source files.


Compilation/Installation


Configuration

After cloning the repository, you must create a configuration file for licensegen to read settings from, i.e. you name or email address.

Here is a default licensegen.json:

{ 
   "Author": {
    "FirstName":"firstname",
    "LastName":"lastname",
    "EmailAddress":"user@example.com",
    "Website":"http://www.example.com"
   },

  -- snip --

Modify the settings to match your personal details. You may leave Email Address and/or Website empty and it will not appear in the generated output.

Adding a new license

To make a new license template available, you must:

  • Create a NAME.license file in the licenses/ directory, containing the contents of the license with variables such as Year replaced with the appropriate go template variable. See existing license templates for available template variables.
  • Create a NAME.header file in the licenses/ directory, also with the appropriate template variables.
  • Add a new entry to licensegen.json, under "Licenses":
{ "Name": "NAME", "LicenseFile":"licenses/NAME.license", "HeaderFile":"licenses/NAME.header" }

Usage

Using licensegen is fairly simple. After compiling, run $ licensegen --list to list which license templates are available. Next, run $ licensegen --license [license-name].

This will generate a LICENSE file and a LICENSE_FILE_HEADER file into the current directory.

The LICENSE file contains the selected license with name, email, website, copyright year, etc. completed according to your licensegen.json configuration.

The LICENSE_FILE_HEADER file contains a commented header to insert at the top of each file in your project.


Usage Examples

  • $ licensegen --list
  • $ licensegen --license MIT
  • $ licensegen MIT
  • $ licensegen Apache-2.0

Available Licenses

  • Apache 2.0
  • GPL 2.0
  • GPL 3.0
  • MIT
  • MPL 2.0
  • None (simple copyright)

@todo

  • complete the README
  • add README entry to explain how to add new license templates
  • add more license templates
  • add interactive mode when started with -i flag

Licensing

licensegen is open source software, available under the MIT license.

Documentation

Overview

* licensegen -- generate a LICENSE file for a project * v1.0.0 2015-07-18_01 * *

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址