| ... | @@ -1,26 +1,16 @@ | ... | @@ -1,26 +1,16 @@ |
| 1 | # zig-detect-license | 1 | # zig-detect-license |
| 2 | | 2 | |
| 3 | Given an input text guess which SPDX license it most likely is an instance of | 3 |  |
| 4 | | 4 | [](https://github.com/nektro/zig-detect-license/blob/master/LICENSE) |
| 5 | ## Built With | 5 | [](https://github.com/sponsors/nektro) |
| 6 | - https://github.com/ziglang/zig master | 6 | [](https://ziglang.org/) |
| 7 | - https://github.com/nektro/zigmod package manager | 7 | [](https://github.com/nektro/zigmod) |
| 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 | | 8 | |
| 13 | ## Install | 9 | Given an input text guess which SPDX license it most likely is an instance of |
| 14 | ``` | | |
| 15 | zigmod aq add 1/nektro/detect-license | | |
| 16 | ``` | | |
| 17 | | 10 | |
| 18 | ## Usage | 11 | ## Usage |
| 19 | - `pub fn detect(alloc: *std.mem.Allocator, license_src: []const u8) ![]const u8` | 12 | - `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 |
| 21 | | 14 | |
| 22 | - `pub fn detectInDir(alloc: *std.mem.Allocator, dir: std.fs.Dir) !?[]const u8` | 15 | - `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. | 16 | - 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 | | |