authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-04-18 15:32:47 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-04-18 15:32:47 -07:00
logcc5c94aeb57c6a3ffd81b4c9acfe90b1dc9bbbb4
tree588f2282321e631da204c0217e51e0957c7c9218
parent66eeee1ae6caffc37029f16744017bca8409dbe5

remove u.print


4 files changed, 7 insertions(+), 11 deletions(-)

src/cmd/init.zig+1-1
......@@ -69,7 +69,7 @@ pub fn execute(args: [][]u8) !void {
6969 .lib => try writeLibManifest(w, id, name, entry.?, license, description),
7070 }
7171 std.debug.print("\n", .{});
72 u.print("Successfully initialized new package {s}!\n", .{name});
72 std.debug.print("Successfully initialized new package {s}!\n", .{name});
7373 },
7474 }
7575
src/common.zig+1-1
......@@ -113,7 +113,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) !
113113 if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv;
114114
115115 if (options.log and d.type != .local) {
116 u.print("fetch: {s}: {s}", .{ @tagName(d.type), d.path });
116 std.debug.print("fetch: {s}: {s}\n", .{ @tagName(d.type), d.path });
117117 }
118118 defer {
119119 if (!bootstrap and options.log and d.type != .local) {
src/main.zig+4-4
......@@ -20,16 +20,16 @@ pub fn main() !void {
2020 const available = if (build_options.bootstrap) zigmod.commands_to_bootstrap else zigmod.commands;
2121
2222 if (args.len == 0) {
23 u.print("zigmod {s} {s} {s} {s}", .{
23 std.debug.print("zigmod {s} {s} {s} {s}\n", .{
2424 build_options.version,
2525 @tagName(builtin.os.tag),
2626 @tagName(builtin.cpu.arch),
2727 @tagName(builtin.abi),
2828 });
29 u.print("", .{});
30 u.print("The commands available are:", .{});
29 std.debug.print("\n", .{});
30 std.debug.print("The commands available are:\n", .{});
3131 inline for (comptime std.meta.declarations(available)) |decl| {
32 u.print(" - {s}", .{decl.name});
32 std.debug.print(" - {s}\n", .{decl.name});
3333 }
3434 return;
3535 }
src/util/funcs.zig+1-5
......@@ -11,16 +11,12 @@ pub const kb = b * 1024;
1111pub const mb = kb * 1024;
1212pub const gb = mb * 1024;
1313
14pub fn print(comptime fmt: string, args: anytype) void {
15 std.debug.print(fmt ++ "\n", args);
16}
17
1814const ansi_red = "\x1B[31m";
1915const ansi_reset = "\x1B[39m";
2016
2117pub fn assert(ok: bool, comptime fmt: string, args: anytype) void {
2218 if (!ok) {
23 print(ansi_red ++ fmt ++ ansi_reset, args);
19 std.debug.print(ansi_red ++ fmt ++ ansi_reset ++ "\n", args);
2420 std.os.exit(1);
2521 }
2622}