From 7fc911b1a8518d79c3fda9e326fa4ce985dfce3d Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 9 Apr 2024 12:16:25 -0500 Subject: [PATCH] actually use stdout --- pkgs/oizys/oizys-zig/src/Oizys.zig | 9 ++++++--- pkgs/oizys/oizys-zig/src/main.zig | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/oizys/oizys-zig/src/Oizys.zig b/pkgs/oizys/oizys-zig/src/Oizys.zig index 93eb68c..b62f0ab 100644 --- a/pkgs/oizys/oizys-zig/src/Oizys.zig +++ b/pkgs/oizys/oizys-zig/src/Oizys.zig @@ -24,8 +24,10 @@ pub const OizysCmd = enum { pub fn init(allocator: std.mem.Allocator, matches: *const ArgMatches) !Oizys { const cmd = matches.subcommand.?.name; const flags = matches.subcommandMatches(cmd).?; - const host = flags.getSingleValue("host") orelse try Oizys.getDefaultHostName(allocator); - const flake = flags.getSingleValue("flake") orelse try Oizys.getDefaultFlake(allocator); + const host = flags.getSingleValue("host") orelse + try Oizys.getDefaultHostName(allocator); + const flake = flags.getSingleValue("flake") orelse + try Oizys.getDefaultFlake(allocator); return Oizys{ .allocator = allocator, @@ -127,7 +129,8 @@ pub fn run(self: *Oizys) !void { try self.runNixCmd(NixCmd.Nix, &.{ "build", self.output }); }, .output => { - std.debug.print("{s}", .{self.output}); + const stdout = std.io.getStdOut().writer(); + try stdout.print("{s}\n", .{self.output}); }, .cache => { try self.cache(); diff --git a/pkgs/oizys/oizys-zig/src/main.zig b/pkgs/oizys/oizys-zig/src/main.zig index 22a6e21..269fd92 100644 --- a/pkgs/oizys/oizys-zig/src/main.zig +++ b/pkgs/oizys/oizys-zig/src/main.zig @@ -18,5 +18,4 @@ pub fn main() !void { var oizys = try Oizys.init(allocator, matches); try oizys.run(); - }