add-license

Crates.ioadd-license
lib.rsadd-license
version0.2.1
sourcesrc
created_at2024-05-19 02:42:40.812342
updated_at2024-06-06 15:39:27.348643
descriptionSubcommand for Cargo that creates a file with a user-defined license in the project's directory.
homepage
repositoryhttps://gitlab.com/marquess-projects/add-license
max_upload_size
id1244627
size149,795
Pablo Marques (marquesrs)

documentation

README

About

A Cargo subcommand that creates a file with a user-defined license in the project's directory.

Installation

Download from crates.io:
cargo add add-license
or download Source Code

Install the crate with:
cargo install add-license
or locally with cargo install --path .

Usage

cargo add-license
Creates the LICENSE file based on your Cargo.toml file. If you have 'authors' and 'year' attributes there, it will replace the <name>, <year> fields inside the LICENSE file.

  • The license attribute in Cargo.toml must be ONE of [AGPL-3.0-only, Apache-2.0, BSD-2-Clause, BSD-3-Clause, GPL-2.0, GPL-3.0, LGPL-2.1, MIT]

cargo add-license MIT
Replaces the 'license' attribute inside Cargo.toml and creates a LICENSE file. If you have 'authors' and 'year' attributes there, it will replace the <name>, <year> fields inside the LICENSE file.

  • The license argument must be ONE of [AGPL3, APACHE2, BSD2, BSD3, GPL2, GPL3, LGPL2.1, MIT]

cargo add-license -y:2024
ONLY replaces the 'year' attribute inside Cargo.toml.

cargo add-license -a:Pablo_Marques,Carl_Menger
ONLY replaces the 'authors' attribute inside Cargo.toml.

  • Replace all spaces between names with '_', and place no space after the ',' symbol.

All valid commands:
cargo add-license

cargo add-license MIT
cargo add-license -y:2024
cargo add-license -a:Mary_Johnson,Carl_Menger

cargo add-license MIT -y:2024
cargo add-license MIT -a:Marques
cargo add-license -y:2024 -a:Marques
cargo add-license -a:Marques -y:2024

cargo add-license MIT -y:2024 -a:Marques
cargo add-license MIT -a:Marques -y:2024

DO NOT FORGET
If you do not specify 'authors' and a 'year' in Cargo.toml OR in the command argument, your LICENSE will be created with the default <year> and <authors> fields.

Commit count: 12

cargo fmt