Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

handleVerbose

Intention of verbose is to print all sub-process command lines to stderr before spawning them.

Graph.handleVerbose
pub fn handleVerbose(
    graph: *const Graph,
    cwd: ?[]const u8,
    opt_env: ?*const std.process.Environ.Map,
    argv: []const []const u8,
) error

File

Code

pub fn handleVerbose(
    graph: *const Graph,
    cwd: ?[]const u8,
    opt_env: ?*const std.process.Environ.Map,
    argv: []const []const u8,
) error{OutOfMemory}!void {
    if (!graph.verbose) return;
    const arena = graph.arena;
    const text = try std.zig.allocPrintCmd(arena, argv, .{
        .cwd = cwd,
        .parent_env = &graph.environ_map,
        .child_env = opt_env,
    });
    defer arena.free(text);
    std.log.scoped(.verbose).info("{s}", .{text});
}