| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | # zig-detect-license |
| 2 | |
| 3 | Given 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 |
| 12 | |
| 13 | ## Install |
| 14 | ``` |
| 15 | zigmod aq add 1/nektro/detect-license |
| 16 | ``` |
| 17 | |
| 18 | ## Usage |
| 19 | - `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 |
| 21 | |
| 22 | - `pub fn detectInDir(alloc: *std.mem.Allocator, dir: std.fs.Dir) !?[]const u8` |
| 23 | - 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 |
| 26 | MIT |