Crates.io | licensit |
lib.rs | licensit |
version | 1.2.0 |
source | src |
created_at | 2023-10-18 13:40:15.961945 |
updated_at | 2024-03-18 16:00:33.876747 |
description | Command-line tool to create LICENSE files |
homepage | https://github.com/neuromeow/licensit |
repository | https://github.com/neuromeow/licensit |
max_upload_size | |
id | 1006782 |
size | 234,690 |
licensit
is a command-line tool to create LICENSE files.
Compiled binary versions of licensit
are uploaded to GitHub when a release is made.
You can install licensit
manually by downloading a release, extracting it, and copying the binary to a directory in your $PATH
, such as /usr/local/bin
.
If you already have a Rust environment set up, you can use the cargo install
command:
cargo install licensit
Cargo will build the licensit
binary and place it in $HOME/.cargo
.
licensit
simplifies the process of creating and managing license files for your projects.
licensit list
Shows all supported licenses.
To view the content of a specific license with the author and year filled in:
licensit show [LICENSE] [--user USER] [--year YEAR]
[LICENSE]
: The ID of the license you want to display (for example, mit
, apache-2.0
)--user [USER]
: Specifies the license holder's name. If not provided, licensit
will use the following sources in order to determine the user name:
LICENSE_AUTHOR
environment variableuser.name
entry in the $HOME/.gitconfig
file--year [YEAR]
: Sets the year during which the license is effective. Defaults to the current year if not specifiedTo display just the template of a license (without any specific user or year information):
licensit show [LICENSE] --template
[LICENSE]
: The ID of the license whose template you want to display (for example, mit
, apache-2.0
)--template
: Displays the license template with placeholders for the user and year. This option cannot be used with --user
or --year
To add a license file to your current directory:
licensit add [LICENSE] [--user USER] [--year YEAR]
Creates a LICENSE
file in the current directory with the specified details.
licensit help [COMMAND]
Provides detailed help for a specific command (list
, show
, or add
).
To add a new license to licensit
, place the license template file in the data/licenses
directory or a subfolder.
Then, update the licenses.yml
file, specifying the short name, full name of the license, placeholders for the author and year (if needed), and the path to the template file within the data/licenses
structure.
This setup allows for the easy expansion of licensit by adding new licenses without altering the existing codebase.
In the current version of licensit
, the tests primarily focus on command execution, covering basic scenarios such as specifying the user via an option or determining the author through an environment variable.
Consequently, the automated tests are limited and utilize the MIT license template as a representative example.
These tests do not cover scenarios without explicitly specifying a user or author, potentially missing out on capturing the full range of tool usage.
This project is released under the MIT License. See LICENSE for the full licensing condition.