summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig
index 0a6f333..42675b5 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -8,8 +8,14 @@ var stdout_writer = std.fs.File.stdout().writerStreaming(&.{});
const stdout = &stdout_writer.interface;
pub fn main() !void {
- try stdout.print("$ ", .{});
+ while (true) {
+ try stdout.print("$ ", .{});
- const command = try stdin.takeDelimiter('\n');
- try stdout.print("{s}: command not found\n", .{command.?});
+ const command = try stdin.takeDelimiter('\n');
+ if (command) |cmd| {
+ try stdout.print("{s}: command not found\n", .{cmd});
+ } else {
+ break;
+ }
+ }
}