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| {
4040⬇️
4141
4242```zig
43run_cmd.addBuildPositionals();
43run_cmd.addCliExtras();
4444```
lib/compiler/Maker/Step/Run.zig+2-2
......@@ -177,7 +177,7 @@ pub fn make(
177177 });
178178 argv_list.items.len += 1;
179179 },
180 .cli_positionals => {
180 .cli_extras => {
181181 any_cli_positionals = true;
182182 if (maker.run_args) |run_args| {
183183 try argv_list.appendSlice(gpa, run_args);
......@@ -1599,7 +1599,7 @@ pub fn rerunInFuzzMode(
15991599 },
16001600 .output_file => unreachable,
16011601 .output_directory => unreachable,
1602 .cli_positionals => unreachable,
1602 .cli_extras => unreachable,
16031603 }
16041604 }
16051605
lib/compiler/configurer.zig+2-2
......@@ -492,9 +492,9 @@ const Serialize = struct {
492492 .producer = .{ .value = null },
493493 .generated = .{ .value = a.generated_file },
494494 },
495 .cli_positionals => .{
495 .cli_extras => .{
496496 .flags = .{
497 .tag = .cli_positionals,
497 .tag = .cli_extras,
498498 .prefix = false,
499499 .suffix = false,
500500 .basename = false,
lib/init/build.zig+1-1
......@@ -111,7 +111,7 @@ pub fn build(b: *std.Build) void {
111111
112112 // This allows the user to pass arguments to the application in the build
113113 // command itself, like this: `zig build run -- arg1 arg2 etc`
114 run_cmd.addCliPositionals();
114 run_cmd.addCliExtras();
115115
116116 // Creates an executable that will run `test` blocks from the provided module.
117117 // 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 {
567567 file_content,
568568 output_file,
569569 output_directory,
570 cli_positionals,
570 cli_extras,
571571 };
572572
573573 pub const Index = IndexType(@This());
lib/std/Build/Step/Run.zig+3-3
......@@ -142,7 +142,7 @@ pub const Arg = union(enum) {
142142 output_file_dep: *Output,
143143 output_directory: *Output,
144144 /// The arguments passed after "--" on the "zig build" CLI.
145 cli_positionals,
145 cli_extras,
146146};
147147
148148pub const PrefixedArtifact = struct {
......@@ -523,10 +523,10 @@ pub fn addArgs(run: *Run, args: []const []const u8) void {
523523///
524524/// In the example command `zig build run -- arg1 arg2`, "arg1" and "arg2" will
525525/// be passed to the process being run.
526pub fn addCliPositionals(run: *Run) void {
526pub fn addCliExtras(run: *Run) void {
527527 const graph = run.step.owner.graph;
528528 const arena = graph.arena;
529 run.argv.append(arena, .cli_positionals) catch @panic("OOM");
529 run.argv.append(arena, .cli_extras) catch @panic("OOM");
530530}
531531
532532pub fn setStdIn(run: *Run, stdin: StdIn) void {