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 {
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();

View File

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