mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-04 00:32:40 +03:00
rename addCliExtras to addPassthruArgs
finally, a good name
This commit is contained in:
+1
-1
@@ -40,5 +40,5 @@ if (b.args) |args| {
|
||||
⬇️
|
||||
|
||||
```zig
|
||||
run_cmd.addCliExtras();
|
||||
run_cmd.addPassthruArgs();
|
||||
```
|
||||
|
||||
@@ -177,7 +177,7 @@ pub fn make(
|
||||
});
|
||||
argv_list.items.len += 1;
|
||||
},
|
||||
.cli_extras => {
|
||||
.passthru => {
|
||||
any_cli_positionals = true;
|
||||
if (maker.run_args) |run_args| {
|
||||
try argv_list.appendSlice(gpa, run_args);
|
||||
@@ -1599,7 +1599,7 @@ pub fn rerunInFuzzMode(
|
||||
},
|
||||
.output_file => unreachable,
|
||||
.output_directory => unreachable,
|
||||
.cli_extras => unreachable,
|
||||
.passthru => unreachable,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -492,9 +492,9 @@ const Serialize = struct {
|
||||
.producer = .{ .value = null },
|
||||
.generated = .{ .value = a.generated_file },
|
||||
},
|
||||
.cli_extras => .{
|
||||
.passthru => .{
|
||||
.flags = .{
|
||||
.tag = .cli_extras,
|
||||
.tag = .passthru,
|
||||
.prefix = false,
|
||||
.suffix = false,
|
||||
.basename = false,
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ pub fn build(b: *std.Build) void {
|
||||
|
||||
// This allows the user to pass arguments to the application in the build
|
||||
// command itself, like this: `zig build run -- arg1 arg2 etc`
|
||||
run_cmd.addCliExtras();
|
||||
run_cmd.addPassthruArgs();
|
||||
|
||||
// Creates an executable that will run `test` blocks from the provided module.
|
||||
// Here `mod` needs to define a target, which is why earlier we made sure to
|
||||
|
||||
@@ -567,7 +567,7 @@ pub const Step = extern struct {
|
||||
file_content,
|
||||
output_file,
|
||||
output_directory,
|
||||
cli_extras,
|
||||
passthru,
|
||||
};
|
||||
|
||||
pub const Index = IndexType(@This());
|
||||
|
||||
@@ -142,7 +142,7 @@ pub const Arg = union(enum) {
|
||||
output_file_dep: *Output,
|
||||
output_directory: *Output,
|
||||
/// The arguments passed after "--" on the "zig build" CLI.
|
||||
cli_extras,
|
||||
passthru,
|
||||
};
|
||||
|
||||
pub const PrefixedArtifact = struct {
|
||||
@@ -517,16 +517,18 @@ pub fn addArgs(run: *Run, args: []const []const u8) void {
|
||||
for (args) |arg| run.addArg(arg);
|
||||
}
|
||||
|
||||
/// Any extra positional args are provided to the `zig build` command, they are
|
||||
/// appended here. This causes the step to be considered to have side effects,
|
||||
/// disabling caching.
|
||||
/// Appends the extra arguments provided to `zig build` to the command line
|
||||
/// that will be passed to the process being run.
|
||||
///
|
||||
/// This causes the step to be considered to have side effects, disabling
|
||||
/// caching.
|
||||
///
|
||||
/// In the example command `zig build run -- arg1 arg2`, "arg1" and "arg2" will
|
||||
/// be passed to the process being run.
|
||||
pub fn addCliExtras(run: *Run) void {
|
||||
pub fn addPassthruArgs(run: *Run) void {
|
||||
const graph = run.step.owner.graph;
|
||||
const arena = graph.arena;
|
||||
run.argv.append(arena, .cli_extras) catch @panic("OOM");
|
||||
run.argv.append(arena, .passthru) catch @panic("OOM");
|
||||
}
|
||||
|
||||
pub fn setStdIn(run: *Run, stdin: StdIn) void {
|
||||
|
||||
Reference in New Issue
Block a user