diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-08 22:53:51 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-08 22:53:51 -0500 |
| commit | 8b2622cdd58cec697d9d1f8f49717b6ce7ee3e2e (patch) | |
| tree | 3de817be4757dd1ad0bbdc0c7c3f863deb0f1d43 /test/cli.zig | |
| parent | 5874cb04bd544ca155d1489bb0bdf9397fa3b41c (diff) | |
| download | zig-8b2622cdd58cec697d9d1f8f49717b6ce7ee3e2e.tar.gz zig-8b2622cdd58cec697d9d1f8f49717b6ce7ee3e2e.zip | |
std.fmt.format: tuple parameter instead of var args
Diffstat (limited to 'test/cli.zig')
| -rw-r--r-- | test/cli.zig | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/cli.zig b/test/cli.zig index b36742566a..0527b5c923 100644 --- a/test/cli.zig +++ b/test/cli.zig @@ -19,11 +19,11 @@ pub fn main() !void { a = &arena.allocator; const zig_exe_rel = try (arg_it.next(a) orelse { - std.debug.warn("Expected first argument to be path to zig compiler\n"); + std.debug.warn("Expected first argument to be path to zig compiler\n", .{}); return error.InvalidArgs; }); const cache_root = try (arg_it.next(a) orelse { - std.debug.warn("Expected second argument to be cache root directory path\n"); + std.debug.warn("Expected second argument to be cache root directory path\n", .{}); return error.InvalidArgs; }); const zig_exe = try fs.path.resolve(a, &[_][]const u8{zig_exe_rel}); @@ -45,39 +45,39 @@ pub fn main() !void { fn unwrapArg(arg: UnwrapArgError![]u8) UnwrapArgError![]u8 { return arg catch |err| { - warn("Unable to parse command line: {}\n", err); + warn("Unable to parse command line: {}\n", .{err}); return err; }; } fn printCmd(cwd: []const u8, argv: []const []const u8) void { - std.debug.warn("cd {} && ", cwd); + std.debug.warn("cd {} && ", .{cwd}); for (argv) |arg| { - std.debug.warn("{} ", arg); + std.debug.warn("{} ", .{arg}); } - std.debug.warn("\n"); + std.debug.warn("\n", .{}); } fn exec(cwd: []const u8, argv: []const []const u8) !ChildProcess.ExecResult { const max_output_size = 100 * 1024; const result = ChildProcess.exec(a, argv, cwd, null, max_output_size) catch |err| { - std.debug.warn("The following command failed:\n"); + std.debug.warn("The following command failed:\n", .{}); printCmd(cwd, argv); return err; }; switch (result.term) { .Exited => |code| { if (code != 0) { - std.debug.warn("The following command exited with error code {}:\n", code); + std.debug.warn("The following command exited with error code {}:\n", .{code}); printCmd(cwd, argv); - std.debug.warn("stderr:\n{}\n", result.stderr); + std.debug.warn("stderr:\n{}\n", .{result.stderr}); return error.CommandFailed; } }, else => { - std.debug.warn("The following command terminated unexpectedly:\n"); + std.debug.warn("The following command terminated unexpectedly:\n", .{}); printCmd(cwd, argv); - std.debug.warn("stderr:\n{}\n", result.stderr); + std.debug.warn("stderr:\n{}\n", .{result.stderr}); return error.CommandFailed; }, } |
