actually use stdout

This commit is contained in:
Daylin Morgan 2024-04-09 12:16:25 -05:00
parent a160e2eccc
commit 7fc911b1a8
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 6 additions and 4 deletions

View file

@ -24,8 +24,10 @@ pub const OizysCmd = enum {
pub fn init(allocator: std.mem.Allocator, matches: *const ArgMatches) !Oizys { pub fn init(allocator: std.mem.Allocator, matches: *const ArgMatches) !Oizys {
const cmd = matches.subcommand.?.name; const cmd = matches.subcommand.?.name;
const flags = matches.subcommandMatches(cmd).?; const flags = matches.subcommandMatches(cmd).?;
const host = flags.getSingleValue("host") orelse try Oizys.getDefaultHostName(allocator); const host = flags.getSingleValue("host") orelse
const flake = flags.getSingleValue("flake") orelse try Oizys.getDefaultFlake(allocator); try Oizys.getDefaultHostName(allocator);
const flake = flags.getSingleValue("flake") orelse
try Oizys.getDefaultFlake(allocator);
return Oizys{ return Oizys{
.allocator = allocator, .allocator = allocator,
@ -127,7 +129,8 @@ pub fn run(self: *Oizys) !void {
try self.runNixCmd(NixCmd.Nix, &.{ "build", self.output }); try self.runNixCmd(NixCmd.Nix, &.{ "build", self.output });
}, },
.output => { .output => {
std.debug.print("{s}", .{self.output}); const stdout = std.io.getStdOut().writer();
try stdout.print("{s}\n", .{self.output});
}, },
.cache => { .cache => {
try self.cache(); try self.cache();

View file

@ -18,5 +18,4 @@ pub fn main() !void {
var oizys = try Oizys.init(allocator, matches); var oizys = try Oizys.init(allocator, matches);
try oizys.run(); try oizys.run();
} }