commit 42658de76287ecd24691d774232c5ec07107a0ee (tree)
parent 20e20f9238b1f4537a8186d80afbdf7516e127f6
Author: Andrew Kelley <andrew@ziglang.org>
Date: Sun, 16 Jun 2024 19:28:13 -0700
std.process.Child: `run` fn accepts std.Progress.Node
There was not a way to pass a progress node to this function until now.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/std/process/Child.zig b/lib/std/process/Child.zig
@@ -101,7 +101,7 @@ resource_usage_statistics: ResourceUsageStatistics = .{},
///
/// The child's progress tree will be grafted into the parent's progress tree,
/// by substituting this node with the child's root node.
-progress_node: std.Progress.Node = .{ .index = .none },
+progress_node: std.Progress.Node = std.Progress.Node.none,
pub const ResourceUsageStatistics = struct {
rusage: @TypeOf(rusage_init) = rusage_init,
@@ -376,6 +376,7 @@ pub fn run(args: struct {
env_map: ?*const EnvMap = null,
max_output_bytes: usize = 50 * 1024,
expand_arg0: Arg0Expand = .no_expand,
+ progress_node: std.Progress.Node = std.Progress.Node.none,
}) RunError!RunResult {
var child = ChildProcess.init(args.argv, args.allocator);
child.stdin_behavior = .Ignore;
@@ -385,6 +386,7 @@ pub fn run(args: struct {
child.cwd_dir = args.cwd_dir;
child.env_map = args.env_map;
child.expand_arg0 = args.expand_arg0;
+ child.progress_node = args.progress_node;
var stdout = std.ArrayList(u8).init(args.allocator);
var stderr = std.ArrayList(u8).init(args.allocator);