Skip to content

Commit

Permalink
Compilation now works, debugging int serialization in setting of fields
Browse files Browse the repository at this point in the history
  • Loading branch information
BitlyTwiser committed Sep 23, 2024
1 parent aaa4270 commit d0c95d9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/sneaky.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const std = @import("std");
const builtin = @import("builtin");
const assert = std.debug.assert;

pub const CliError = error{ InvalidArg, InvalidNumberOfArgs, CliArgumentNotFound, InvalidCommand, HelpCommand, IncorrectArgumentType, RequiredArgumentNotFound, UnexpectedCliType, NonStructPassed, OutOfMemory };
pub const CliError = error{ InvalidArg, InvalidNumberOfArgs, CliArgumentNotFound, InvalidCommand, HelpCommand, IncorrectArgumentType, RequiredArgumentNotFound, UnexpectedCliType, NonStructPassed, OutOfMemory, UnrecognizedSimpleType, Overflow, InvalidCharacter, NotBoolean };

const ArgMetadata = struct {
key: []const u8,
Expand Down Expand Up @@ -232,13 +232,10 @@ pub fn Snek(comptime CliInterface: type) type {
switch (@typeInfo(field.type)) {
// Extract the type of the child since that is what we are after
.Optional => {
std.debug.print("here?\n", .{});
try self.arg_metadata.put(arg_key_d, .{ .key = arg_key_d, .value = std.mem.trim(u8, arg_val_d, " "), .optional = true });
},
// For all other cases just record the type
else => {
std.debug.print("here? else\n", .{});
std.debug.print("{any}\n", .{@typeInfo(field.type)});
try self.arg_metadata.put(arg_key_d, .{ .key = arg_key_d, .value = std.mem.trim(u8, arg_val_d, " "), .optional = false });
},
}
Expand Down

0 comments on commit d0c95d9

Please sign in to comment.