Upgrade all the thingies
This commit is contained in:
parent
599330f0da
commit
68b73910da
5 changed files with 16 additions and 14 deletions
|
|
@ -1,10 +1,12 @@
|
|||
.{
|
||||
.name = "lys",
|
||||
.name = .lys,
|
||||
.version = "0.0.0",
|
||||
.fingerprint = 0x897d096f61b9ad7b,
|
||||
|
||||
.dependencies = .{
|
||||
.chameleon = .{
|
||||
.url = "git+https://github.com/tr1ckydev/chameleon#9724f89ca2e56b33609090a6c6c6c1097844d1ee",
|
||||
.hash = "12208314a762057bf5ed82b26b02cbfcf426066b9920bfdd1ddcb68d1d0c55c45ce3",
|
||||
.url = "git+https://github.com/tr1ckydev/chameleon#ae88d41f061adbf3d8bb569519cb065aad65db06",
|
||||
.hash = "chameleon-2.0.1-ZOxajfpzAADVWecH5mnE4qGV7vO3aMfLPvFUzvQbMqdg",
|
||||
},
|
||||
},
|
||||
.paths = .{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1732014248,
|
||||
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
|
||||
"lastModified": 1746064326,
|
||||
"narHash": "sha256-r7IZkN9NhK/IO9/J6D9ih2P1OXb67nr5HaQ1YAte18w=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
|
||||
"rev": "91bf6dffa21c7709607c9fdbf9a6acb44e7a0a5d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -157,11 +157,11 @@ fn initFromParsed(comptime T: type, allocator: Allocator, flags: []Arg) !T {
|
|||
const this = @TypeOf(result);
|
||||
const info = @typeInfo(this);
|
||||
|
||||
if ((info.Struct.fields.len -| 1) == 0) {
|
||||
if ((info.@"struct".fields.len -| 1) == 0) {
|
||||
return result;
|
||||
}
|
||||
|
||||
inline for (info.Struct.fields) |field| {
|
||||
inline for (info.@"struct".fields) |field| {
|
||||
if (comptime std.mem.eql(u8, field.name, "allocator")) {
|
||||
continue; // skip allocator
|
||||
}
|
||||
|
|
@ -242,7 +242,7 @@ fn initFromParsed(comptime T: type, allocator: Allocator, flags: []Arg) !T {
|
|||
}
|
||||
|
||||
switch (fieldType) {
|
||||
.Optional => |_| {
|
||||
.optional => |_| {
|
||||
log.debug("flag `{s}` is optional, and we couldn't find a value for it, so leaving as default value", .{f.name});
|
||||
comptime continue;
|
||||
},
|
||||
|
|
@ -356,7 +356,7 @@ fn initFromParsed(comptime T: type, allocator: Allocator, flags: []Arg) !T {
|
|||
}
|
||||
} else {
|
||||
switch (fieldType) {
|
||||
.Optional => {
|
||||
.optional => {
|
||||
if (!builtin.is_test) {
|
||||
log.warn("could not find positional argument for `{s}`, using default value", .{field.name});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ fn parseEnumFromStr(comptime T: type, str: []const u8) !T {
|
|||
const info = @typeInfo(T);
|
||||
|
||||
comptime {
|
||||
if (std.meta.activeTag(info) != .Enum) {
|
||||
if (std.meta.activeTag(info) != .@"enum") {
|
||||
@compileError("Expected enum type, got " ++ @typeName(T));
|
||||
}
|
||||
}
|
||||
|
||||
inline for (info.Enum.fields) |field| {
|
||||
inline for (info.@"enum".fields) |field| {
|
||||
const lowerFieldName = try std.ascii.allocLowerString(heapAllocator, field.name);
|
||||
defer heapAllocator.free(lowerFieldName);
|
||||
if (std.mem.eql(u8, lowerFieldName, lower)) {
|
||||
|
|
@ -41,7 +41,7 @@ fn parseEnumFromStr(comptime T: type, str: []const u8) !T {
|
|||
log.err("could not parse `{s}` as enum `{s}`", .{ str, @typeName(T) });
|
||||
log.warn("hint: try one of the following:", .{});
|
||||
|
||||
inline for (info.Enum.fields) |field| {
|
||||
inline for (info.@"enum".fields) |field| {
|
||||
const lowerFieldName = try std.ascii.allocLowerString(heapAllocator, field.name);
|
||||
defer heapAllocator.free(lowerFieldName);
|
||||
log.warn("- {s}", .{lowerFieldName});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const SmartString = @import("../util/utils.zig").SmartString;
|
|||
const log = std.log;
|
||||
|
||||
pub const Level = log.Level;
|
||||
pub const Scope = @Type(.EnumLiteral);
|
||||
pub const Scope = @Type(.enum_literal);
|
||||
|
||||
pub const Color = enum {
|
||||
red,
|
||||
|
|
|
|||
Loading…
Reference in a new issue