authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-30 11:46:56-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:35-07:00
log8f224bc3f0065aaf971126de65b5d56d2d6d522d
treea77b397cea7dfcb441f58711ea2976a0de7b92e3
parent0d95b44a1c9e483beb82f7b70515185159d79bdc

rename addBuildPositionals to addCliExtras

they don't have to be positionals

6 files changed, 10 insertions(+), 10 deletions(-)

BRANCH_TODO+1-1
...@@ -40,5 +40,5 @@ if (b.args) |args| {...@@ -40,5 +40,5 @@ if (b.args) |args| {
40⬇️40⬇️
4141
42```zig42```zig
43run_cmd.addBuildPositionals();43run_cmd.addCliExtras();
44```44```
lib/compiler/Maker/Step/Run.zig+2-2
...@@ -177,7 +177,7 @@ pub fn make(...@@ -177,7 +177,7 @@ pub fn make(
177 });177 });
178 argv_list.items.len += 1;178 argv_list.items.len += 1;
179 },179 },
180 .cli_positionals => {180 .cli_extras => {
181 any_cli_positionals = true;181 any_cli_positionals = true;
182 if (maker.run_args) |run_args| {182 if (maker.run_args) |run_args| {
183 try argv_list.appendSlice(gpa, run_args);183 try argv_list.appendSlice(gpa, run_args);
...@@ -1599,7 +1599,7 @@ pub fn rerunInFuzzMode(...@@ -1599,7 +1599,7 @@ pub fn rerunInFuzzMode(
1599 },1599 },
1600 .output_file => unreachable,1600 .output_file => unreachable,
1601 .output_directory => unreachable,1601 .output_directory => unreachable,
1602 .cli_positionals => unreachable,1602 .cli_extras => unreachable,
1603 }1603 }
1604 }1604 }
16051605
lib/compiler/configurer.zig+2-2
...@@ -492,9 +492,9 @@ const Serialize = struct {...@@ -492,9 +492,9 @@ const Serialize = struct {
492 .producer = .{ .value = null },492 .producer = .{ .value = null },
493 .generated = .{ .value = a.generated_file },493 .generated = .{ .value = a.generated_file },
494 },494 },
495 .cli_positionals => .{495 .cli_extras => .{
496 .flags = .{496 .flags = .{
497 .tag = .cli_positionals,497 .tag = .cli_extras,
498 .prefix = false,498 .prefix = false,
499 .suffix = false,499 .suffix = false,
500 .basename = false,500 .basename = false,
lib/init/build.zig+1-1
...@@ -111,7 +111,7 @@ pub fn build(b: *std.Build) void {...@@ -111,7 +111,7 @@ pub fn build(b: *std.Build) void {
111111
112 // This allows the user to pass arguments to the application in the build112 // This allows the user to pass arguments to the application in the build
113 // command itself, like this: `zig build run -- arg1 arg2 etc`113 // command itself, like this: `zig build run -- arg1 arg2 etc`
114 run_cmd.addCliPositionals();114 run_cmd.addCliExtras();
115115
116 // Creates an executable that will run `test` blocks from the provided module.116 // Creates an executable that will run `test` blocks from the provided module.
117 // Here `mod` needs to define a target, which is why earlier we made sure to117 // Here `mod` needs to define a target, which is why earlier we made sure to
lib/std/Build/Configuration.zig+1-1
...@@ -567,7 +567,7 @@ pub const Step = extern struct {...@@ -567,7 +567,7 @@ pub const Step = extern struct {
567 file_content,567 file_content,
568 output_file,568 output_file,
569 output_directory,569 output_directory,
570 cli_positionals,570 cli_extras,
571 };571 };
572572
573 pub const Index = IndexType(@This());573 pub const Index = IndexType(@This());
lib/std/Build/Step/Run.zig+3-3
...@@ -142,7 +142,7 @@ pub const Arg = union(enum) {...@@ -142,7 +142,7 @@ pub const Arg = union(enum) {
142 output_file_dep: *Output,142 output_file_dep: *Output,
143 output_directory: *Output,143 output_directory: *Output,
144 /// The arguments passed after "--" on the "zig build" CLI.144 /// The arguments passed after "--" on the "zig build" CLI.
145 cli_positionals,145 cli_extras,
146};146};
147147
148pub const PrefixedArtifact = struct {148pub const PrefixedArtifact = struct {
...@@ -523,10 +523,10 @@ pub fn addArgs(run: *Run, args: []const []const u8) void {...@@ -523,10 +523,10 @@ pub fn addArgs(run: *Run, args: []const []const u8) void {
523///523///
524/// In the example command `zig build run -- arg1 arg2`, "arg1" and "arg2" will524/// In the example command `zig build run -- arg1 arg2`, "arg1" and "arg2" will
525/// be passed to the process being run.525/// be passed to the process being run.
526pub fn addCliPositionals(run: *Run) void {526pub fn addCliExtras(run: *Run) void {
527 const graph = run.step.owner.graph;527 const graph = run.step.owner.graph;
528 const arena = graph.arena;528 const arena = graph.arena;
529 run.argv.append(arena, .cli_positionals) catch @panic("OOM");529 run.argv.append(arena, .cli_extras) catch @panic("OOM");
530}530}
531531
532pub fn setStdIn(run: *Run, stdin: StdIn) void {532pub fn setStdIn(run: *Run, stdin: StdIn) void {