]> gitweb.ps.run Git - ziggit/commitdiff
better cli
authorPatrick Schönberger <patrick.schoenberger@posteo.de>
Fri, 26 Apr 2024 11:28:14 +0000 (13:28 +0200)
committerPatrick Schönberger <patrick.schoenberger@posteo.de>
Fri, 26 Apr 2024 11:28:14 +0000 (13:28 +0200)
main.zig

index 5b68cb9d8a2bc61e6d6e6fac0719d57f7c04b570..42a5a4f92d914132548a48e762249701a4817127 100644 (file)
--- a/main.zig
+++ b/main.zig
@@ -313,9 +313,9 @@ pub fn main() !void {
     var inputBuffer = std.mem.zeroes([1024]u8);
 
     while (true) {
-        const input = try r.readUntilDelimiter(&inputBuffer, '\n');
+        const input = r.readUntilDelimiter(&inputBuffer, '\n') catch continue;
 
-        const id = try std.fmt.parseInt(u160, input, 16);
+        const id = std.fmt.parseInt(u160, input, 16) catch continue;
 
         if (pf.findObjectOffset(id)) |offset| {
             const o = try pf.getObject(offset);
@@ -345,7 +345,7 @@ pub fn main() !void {
                 }
                 print("\n", .{});
             } else {
-                std.debug.print("type: {}\n", .{o.type});
+                std.debug.print("type: {}\n{s}\n", .{ o.type, o.data });
             }
         }
     }