authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-21 13:31:34 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-21 13:31:34 -07:00
log9b85f69e9adc28ec70a217c07b86046e331d3485
tree1205e28bbd458985742b851c009a0eaa58e0bf87
parent3049b32e72045d8cefd64b8a7f9b0b8f9e76d80a

ziginfra README sync


1 files changed, 7 insertions(+), 17 deletions(-)

README.md+7-17
......@@ -1,26 +1,16 @@
11# zig-detect-license
22
3Given an input text guess which SPDX license it most likely is an instance of
4
5## Built With
6- https://github.com/ziglang/zig master
7- https://github.com/nektro/zigmod package manager
8
9- https://github.com/nektro/zig-licenses-text
10- https://github.com/nektro/zig-leven
11- https://github.com/nektro/zig-fs-check
3![loc](https://sloc.xyz/github/nektro/zig-detect-license)
4[![license](https://img.shields.io/github/license/nektro/zig-detect-license.svg)](https://github.com/nektro/zig-detect-license/blob/master/LICENSE)
5[![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro)
6[![Zig](https://img.shields.io/badge/Zig-0.14-f7a41d)](https://ziglang.org/)
7[![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod)
128
13## Install
14```
15zigmod aq add 1/nektro/detect-license
16```
9Given an input text guess which SPDX license it most likely is an instance of
1710
1811## Usage
1912- `pub fn detect(alloc: *std.mem.Allocator, license_src: []const u8) ![]const u8`
20 - Given an input string, will return the SPDX licence identifier for the closest guess to which one it might be
13 - Given an input string, will return the SPDX license identifier for the closest guess to which one it might be
2114
2215- `pub fn detectInDir(alloc: *std.mem.Allocator, dir: std.fs.Dir) !?[]const u8`
2316 - Given a directory, will search for a `LICENSE` file and return the guess for which one it is. Will return `null` if the license file can not be found. If this returns null when you do indeed have a license file, please help expand the search examples by submitting a bug report.
24
25## License
26MIT