diff --git a/src/cmd/init.zig b/src/cmd/init.zig index 13b1636f5e506a68e26934d6a15983db3e2fd8a9..774e99ac5f5682421bcd01a13c6f27b2eadd065d 100644 --- a/src/cmd/init.zig +++ b/src/cmd/init.zig @@ -69,7 +69,7 @@ pub fn execute(args: [][]u8) !void { .lib => try writeLibManifest(w, id, name, entry.?, license, description), } std.debug.print("\n", .{}); - u.print("Successfully initialized new package {s}!\n", .{name}); + std.debug.print("Successfully initialized new package {s}!\n", .{name}); }, } diff --git a/src/common.zig b/src/common.zig index da106f4bf63837953d5f23450570ef8cde33cb25..06b33372e3a7ca7b626e61ef32fd1d1502f42d5e 100644 --- a/src/common.zig +++ b/src/common.zig @@ -113,7 +113,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv; if (options.log and d.type != .local) { - u.print("fetch: {s}: {s}", .{ @tagName(d.type), d.path }); + std.debug.print("fetch: {s}: {s}\n", .{ @tagName(d.type), d.path }); } defer { if (!bootstrap and options.log and d.type != .local) { diff --git a/src/main.zig b/src/main.zig index a07087b8e1c3e39b3cd380f07175f0339107d40f..ed177ac16ab26ef0db03d216d42fd23b61069603 100644 --- a/src/main.zig +++ b/src/main.zig @@ -20,16 +20,16 @@ pub fn main() !void { const available = if (build_options.bootstrap) zigmod.commands_to_bootstrap else zigmod.commands; if (args.len == 0) { - u.print("zigmod {s} {s} {s} {s}", .{ + std.debug.print("zigmod {s} {s} {s} {s}\n", .{ build_options.version, @tagName(builtin.os.tag), @tagName(builtin.cpu.arch), @tagName(builtin.abi), }); - u.print("", .{}); - u.print("The commands available are:", .{}); + std.debug.print("\n", .{}); + std.debug.print("The commands available are:\n", .{}); inline for (comptime std.meta.declarations(available)) |decl| { - u.print(" - {s}", .{decl.name}); + std.debug.print(" - {s}\n", .{decl.name}); } return; } diff --git a/src/util/funcs.zig b/src/util/funcs.zig index b096bb76aa6e552e12f97a224f420d40c4a61231..42d82cc67d8c87365f0eacc0beb25ebe6e2e8d7e 100644 --- a/src/util/funcs.zig +++ b/src/util/funcs.zig @@ -11,16 +11,12 @@ pub const kb = b * 1024; pub const mb = kb * 1024; pub const gb = mb * 1024; -pub fn print(comptime fmt: string, args: anytype) void { - std.debug.print(fmt ++ "\n", args); -} - const ansi_red = "\x1B[31m"; const ansi_reset = "\x1B[39m"; pub fn assert(ok: bool, comptime fmt: string, args: anytype) void { if (!ok) { - print(ansi_red ++ fmt ++ ansi_reset, args); + std.debug.print(ansi_red ++ fmt ++ ansi_reset ++ "\n", args); std.os.exit(1); } }