| author | |
| committer | |
| log | cc5c94aeb57c6a3ffd81b4c9acfe90b1dc9bbbb4 |
| tree | 588f2282321e631da204c0217e51e0957c7c9218 |
| parent | 66eeee1ae6caffc37029f16744017bca8409dbe5 |
4 files changed, 7 insertions(+), 11 deletions(-)
src/cmd/init.zig+1-1| ... | ... | @@ -69,7 +69,7 @@ pub fn execute(args: [][]u8) !void { |
| 69 | 69 | .lib => try writeLibManifest(w, id, name, entry.?, license, description), |
| 70 | 70 | } |
| 71 | 71 | 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}); | |
| 73 | 73 | }, |
| 74 | 74 | } |
| 75 | 75 |
src/common.zig+1-1| ... | ... | @@ -113,7 +113,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! |
| 113 | 113 | if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv; |
| 114 | 114 | |
| 115 | 115 | 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 }); | |
| 117 | 117 | } |
| 118 | 118 | defer { |
| 119 | 119 | if (!bootstrap and options.log and d.type != .local) { |
src/main.zig+4-4| ... | ... | @@ -20,16 +20,16 @@ pub fn main() !void { |
| 20 | 20 | const available = if (build_options.bootstrap) zigmod.commands_to_bootstrap else zigmod.commands; |
| 21 | 21 | |
| 22 | 22 | if (args.len == 0) { |
| 23 | u.print("zigmod {s} {s} {s} {s}", .{ | |
| 23 | std.debug.print("zigmod {s} {s} {s} {s}\n", .{ | |
| 24 | 24 | build_options.version, |
| 25 | 25 | @tagName(builtin.os.tag), |
| 26 | 26 | @tagName(builtin.cpu.arch), |
| 27 | 27 | @tagName(builtin.abi), |
| 28 | 28 | }); |
| 29 | u.print("", .{}); | |
| 30 | u.print("The commands available are:", .{}); | |
| 29 | std.debug.print("\n", .{}); | |
| 30 | std.debug.print("The commands available are:\n", .{}); | |
| 31 | 31 | inline for (comptime std.meta.declarations(available)) |decl| { |
| 32 | u.print(" - {s}", .{decl.name}); | |
| 32 | std.debug.print(" - {s}\n", .{decl.name}); | |
| 33 | 33 | } |
| 34 | 34 | return; |
| 35 | 35 | } |
src/util/funcs.zig+1-5| ... | ... | @@ -11,16 +11,12 @@ pub const kb = b * 1024; |
| 11 | 11 | pub const mb = kb * 1024; |
| 12 | 12 | pub const gb = mb * 1024; |
| 13 | 13 | |
| 14 | pub fn print(comptime fmt: string, args: anytype) void { | |
| 15 | std.debug.print(fmt ++ "\n", args); | |
| 16 | } | |
| 17 | ||
| 18 | 14 | const ansi_red = "\x1B[31m"; |
| 19 | 15 | const ansi_reset = "\x1B[39m"; |
| 20 | 16 | |
| 21 | 17 | pub fn assert(ok: bool, comptime fmt: string, args: anytype) void { |
| 22 | 18 | if (!ok) { |
| 23 | print(ansi_red ++ fmt ++ ansi_reset, args); | |
| 19 | std.debug.print(ansi_red ++ fmt ++ ansi_reset ++ "\n", args); | |
| 24 | 20 | std.os.exit(1); |
| 25 | 21 | } |
| 26 | 22 | } |