diff --git a/src/cmd/license.zig b/src/cmd/license.zig index 42744769c1b531fea02066d0d7d0bbb1f4a888de..e9a1c6a9b17b66606dff9805f12f2df77b710180 100644 --- a/src/cmd/license.zig +++ b/src/cmd/license.zig @@ -58,8 +58,8 @@ pub fn execute(args: [][]u8) !void { var iter = map.iterator(); while (iter.next()) |entry| { std.debug.print(style.Bold ++ "{s}:\n", .{entry.key_ptr.*}); - if (get_license(entry.key_ptr.*)) |license| { - std.debug.print(style.Faint ++ "= {s}\n", .{license.url}); + if (u.list_contains(licenses.spdx, entry.key_ptr.*)) { + std.debug.print(style.Faint ++ "= {s}{s}\n", .{ "https://spdx.org/licenses/", entry.key_ptr.* }); } std.debug.print(style.ResetIntensity, .{}); for (entry.value_ptr.*.items) |item| { @@ -75,13 +75,3 @@ pub fn execute(args: [][]u8) !void { } } } - -fn get_license(name: []const u8) ?licenses.License { - const T = licenses.spdx; - inline for (std.meta.declarations(T)) |decl| { - if (std.mem.eql(u8, decl.name, name)) { - return @field(T, decl.name); - } - } - return null; -} diff --git a/zigmod.lock b/zigmod.lock index 68661da3fa8f386def03b916491ba16faf63c0a0..834ce23507f4413c6255063ce99f26dc90745e76 100644 --- a/zigmod.lock +++ b/zigmod.lock @@ -2,7 +2,7 @@ git https://github.com/yaml/libyaml tag-0.2.5 git https://github.com/nektro/zig-ansi commit-930ab1f373012214e1a362a5d2b2cb2852242620 git https://github.com/ziglibs/known-folders commit-f5e5fb8370de41fbc220c0c0770d62bdf00530ea -git https://github.com/nektro/zig-licenses commit-16272ba5652025d9b840b83a4826746bceb783a7 +git https://github.com/nektro/zig-licenses commit-c9b8cbf3565675a056ad4e9b57cb4f84020e7680 git https://github.com/truemedian/zfetch commit-8bbc7b34cd417794841e1432585334bc969dfe83 git https://github.com/truemedian/hzzp commit-2d30bddae3bf1eaecde5144490307604efe76f2a git https://github.com/alexnask/iguanaTLS commit-0d39a361639ad5469f8e4dcdaea35446bbe54b48 diff --git a/zigmod.sum b/zigmod.sum index 9f18fa205628f7b3cdd9639fbbeb2a1d7d9926d5..08f84236e26697c43da0f6d900beb6162e31f511 100644 --- a/zigmod.sum +++ b/zigmod.sum @@ -1,7 +1,7 @@ blake3-22472b867734926b202c055892fb0abb03f91556cd88998e2fe77addb003b1dd v/git/github.com/yaml/libyaml/tag-0.2.5 blake3-7fc0b46397932ea1f0726d42289606ca118cc745d88dd87c0d6a377ba7c6569f git/github.com/nektro/zig-ansi blake3-35a1c330c9999876e71418a7d43ad24ca7d1e23c3b5576e5cb75667e3392cc10 git/github.com/ziglibs/known-folders -blake3-6e3f314a9f1b80e65f80ec48fe22cedd58821a35235de388948366b531de9d40 git/github.com/nektro/zig-licenses +blake3-42c3fae77ef41d2074e74de2d91cfc66bc591170494b10262dd2aeaea0b60cb5 git/github.com/nektro/zig-licenses blake3-e3072f7fb47e86d53c9a1879e254ba1af55941153fd5f6752ec659b2f14854c9 git/github.com/truemedian/zfetch blake3-98982125d0fbedc62e179e62081d2797a2b8a3623c42f9fd5d72cd56d6350714 git/github.com/truemedian/hzzp blake3-e6901bd7432450d5b22b01880cc7fa3fa2433e766a527206f18b29c67c1349bb git/github.com/alexnask/iguanaTLS