better error handling
This commit is contained in:
parent
a96ff208bd
commit
452f7bfd5d
1 changed files with 7 additions and 0 deletions
|
@ -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});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue