• Stars
    star
    185
  • Rank 208,271 (Top 5 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

write licenses to stdout

licensor

Preview

write licenses to stdout

GitHub Actions crates.io

About

Write a license to standard output given its SPDX ID. A name for the copyright holder can optionally be provided for licenses where it is included. If the provided ID isn't found, similar ones will be suggested. Licenses are all compiled into the binary.

Features

  • Simple
  • Licenses are taken directly from SPDX, no slightly edited templates
  • Single binary, licenses are included into it at compile time
  • WITH exception expressions support
  • Ability to skip the copyright notice, which is allowed by the Berne convention
  • Adding new licenses just requires editing a JSON file

Why

I just got tired of losing time looking for license files for my new projects.

Usage

Here are a couple usage examples to get a general idea of how it all works. For detailed usage, just pass the --help flag.

Write the MIT license with a copyright notice to LICENSE:

$ licensor MIT "Raphaël Thériault" > LICENSE

Write the Apache 2.0 license with the LLVM exception to LICENSE, skipping optional parts:

$ licensor "Apache-2.0 WITH LLVM-exception" --skip-optional > LICENSE

Print the BSD 3 Clause license without a copyright notice:

$ licensor BSD-3-Clause

List available licenses

$ licensor --licenses

Installation

There are a few installation option available.

You are welcome to distribute this software on other platforms, don't hesitate to open a PR to update this section if you do so!

Releases

Pre-compiled binaries of licensor can be downloaded from the release page.

Homebrew

$ brew install licensor

Crates.io

$ cargo install licensor

Available licenses and exceptions

See list.

Contributing

Contributors are welcome. If you see anything that could be fixed/improved or have a new feature idea, just open an issue or a PR!

However, try to keep the main CLI as simple and light as possible. Features such as adding licenses/exceptions at runtime or validating licenses are not planned and will not be added.

Adding licenses

If you'd like a license to be added to the list, you can either open an issue for it or add it yourself, which is fairly easy.

To add a license, just add it to resources/licenses.json following the schema provided in resources/licenses-schema.json. To apply the changes to the main CLI, you'll also need to run both cargo run -p licensor_fetch and cargo run -p licensor_codegen, in that order. To get the information you need, just refer to the SPDX License List.

The same goes for exceptions.

How it works

First, licenses and exceptions specified in the resources files are parsed from the SPDX License List, then gzipped, using the licensor_fetch subcrate. Then the codegen.rs file is automatically generated based on the parsed licenses, using the licensor_codegen subcrate, and included in the CLI.

Finally, the main CLI is built on its own, which makes the build time relatively fast for end users and only requires dependencies of the main CLI and not ones required by helper subcrates.

Credits

Thanks to the amazing people on the /r/rust subreddit who provided great feedback and hints, and showed way more enthusiasm than initially expected.

Licensing

licensor is licensed under the MIT License.

More Repositories

1

filite

A simple, light and standalone pastebin, URL shortener and file-sharing service
Rust
189
star
2

serde-partial

Serde partial serialization made easy
Rust
39
star
3

unprotect-office

Easily remove write protection from Microsoft Office files
C#
30
star
4

async-into-future

Rust
11
star
5

wae

An async executor based on the Win32 thread pool API
Rust
10
star
6

Hydra

A simple streaming webserver that runs anywhere .NET 6 runs
C#
9
star
7

bmbf-mod-template

Mod template for Beat Saber Oculus Quest mods using BMBF
C++
8
star
8

lilac

The greatest audio codec of all
Rust
5
star
9

bm2

CLI for the Beat Saber mod repository BeatMods2
Rust
5
star
10

BLAKE3.NET

C# port of the reference implementation of BLAKE3
C#
4
star
11

paranoid-android

Integration layer between tracing and Android logs
Rust
4
star
12

pxx

Proxy connections while executing commands
Rust
3
star
13

setup-rust-action

Set up your GitHub Actions workflow with a specific version of Rust
TypeScript
3
star
14

stack-bad

stack bad is a brainfuck inspired, Turing complete language whose syntax can be boiled down to "stack bad"
Rust
3
star
15

bsqmu

Beat Saber Quest Modding Utility
C++
2
star
16

lib-cemu

Lightweight Node.js library for Cemu utils
JavaScript
2
star
17

zwc

Rust library for encoding binary data using zero-width characters
Rust
2
star
18

quest-mathfuck

who needs math
Rust
1
star
19

chene

a good web framework
TypeScript
1
star
20

quest-hook-template

A template for writing mods for Quest il2cpp games in Rust using quest-hook
Rust
1
star
21

progress.h

A dead simple C progress bar
C
1
star
22

blisters

Rust (and WebAssembly) implementation of the Blister Beat Saber playlist format
Rust
1
star
23

random.hpp

Single header C++20 convenience wrapper around C++11 random engines
C++
1
star
24

bs-quest-index

Rust
1
star
25

synthriders_rs

Synth Riders BeatMap parser and JSON schemas
Rust
1
star
26

session-0sw

Rust
1
star
27

libraryan

Self-hosted web ebook library
Rust
1
star
28

qrtdb

Quest Runtime Debugger
Rust
1
star
29

pasrel

A typed, composable and functional web server framework
TypeScript
1
star
30

BeatMods2-Client

Official web client for BeatMods2
Vue
1
star
31

ipp

Rust
1
star
32

songe-converter-web

Convert Beat Saber Custom Songs to the NEW format, on the web
JavaScript
1
star
33

GitHubProxy

C#
1
star
34

ObamaS

The Obama System, or ObamaS, an entreprise grade x86_64 operating system
Rust
1
star
35

BinaryBlister

C#
1
star
36

blist

Rust
1
star