Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow licenses to be specified during cargo new #2013

Closed

Commits on Dec 20, 2015

  1. Allow licenses to be specified during cargo new

    This pull request would allow a user to specify a license to include
    with their project. If the user specifies a license, a line is added
    to `Cargo.toml` specifying the license, and in the case of some
    licenses, the actual `LICENSE` file is added to the initial project.
    
    A user can put their choice(s) of license in a `.cargo/config` file,
    like so:
    
    ```toml
    [cargo-new]
    license = "MIT/Apache-2.0"
    ```
    
    or it can be specified on the command line when a project is created:
    
    ```bash
    $ cargo new project-name --license "MIT/Apache-2.0"
    ```
    
    There are 5 licenses that I have included the actual LICENSE files for:
    
      * MIT
      * Apache-2.0
      * BSD-3-Clause
      * MPL-2.0
      * GPL-3.0
    
    If the user chooses any of these licenses, the corresponding `LICENSE`
    file is generated and added to their project. In the case of multiple
    licenses, each `LICENSE` file has a suffix added to the file name. So,
    if a project was dual-licensed "MIT/Apache-2.0", their project would
    include the files `LICENSE-MIT` and `LICENSE-APACHE-2.0`.
    
    If the license is not one of these, the entry is still added to
    `Cargo.toml`, and a `LICENSE` file is still added to the repository,
    though it is content-less.
    Paul Woolcock committed Dec 20, 2015
    Configuration menu
    Copy the full SHA
    acc4b21 View commit details
    Browse the repository at this point in the history
  2. Error out when an unknown license is passed in

    Paul Woolcock committed Dec 20, 2015
    Configuration menu
    Copy the full SHA
    fe0839a View commit details
    Browse the repository at this point in the history
  3. Update some documentation and the shell completion files

    Paul Woolcock committed Dec 20, 2015
    Configuration menu
    Copy the full SHA
    5938a74 View commit details
    Browse the repository at this point in the history
  4. automatically write the year, and the copyright holders, into the lic…

    …ense files
    Paul Woolcock committed Dec 20, 2015
    Configuration menu
    Copy the full SHA
    8f3bed0 View commit details
    Browse the repository at this point in the history
  5. Add --license-file option

    Paul Woolcock committed Dec 20, 2015
    Configuration menu
    Copy the full SHA
    10f423f View commit details
    Browse the repository at this point in the history
  6. Reformat licenses to fit all lines into 80 columns

    Paul Woolcock committed Dec 20, 2015
    Configuration menu
    Copy the full SHA
    0d77f7e View commit details
    Browse the repository at this point in the history