From 3d5205d3e4f472a67131ccffb5704d8696162999 Mon Sep 17 00:00:00 2001 From: Nikhil Dave Date: Fri, 3 May 2024 09:47:06 -0700 Subject: [PATCH] fix README example and module add in installing The example program for using termsize and the exe.addModule line are out of date (as far as I can tell). I just copied the current example into the README and changed addModule to root_module.addImport. --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d9e36ab..dac6755 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,10 @@ const std = @import("std"); const termsize = @import("termsize"); pub fn main() !void { - std.debug.println("{any}", .{ termsize.termSize(std.io.getStdOut()) }); + std.debug.print( + "{any}", + .{termsize.termSize(std.io.getStdOut())}, + ); } ``` @@ -80,7 +83,7 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); + // 👇 add the termsize module to executable -+ exe.addModule("termsize", termsize); ++ exe.root_module.addImport("termsize", termsize); b.installArtifact(exe); }