better error handling

This commit is contained in:
Lynn Leichtle 2024-09-16 12:32:46 +02:00
parent a96ff208bd
commit 452f7bfd5d
Signed by: lynn
GPG key ID: 55E797F631DDA03C

View file

@ -51,6 +51,13 @@ fn handleMemoryCommand(memory: *mem.Memory, it: anytype) !void {
const value = try std.fmt.parseUnsigned(u8, maybe_value.?, 10); const value = try std.fmt.parseUnsigned(u8, maybe_value.?, 10);
_ = try memory.writeByte(addr, value); _ = try memory.writeByte(addr, value);
} }
} else {
std.debug.print(
\\Invalid argument '{s}'. Usage:
\\ mem read <addr>
\\ mem write <adrr> <value>
\\
, .{next_argument});
} }
} }
} }