File tree 3 files changed +18
-0
lines changed
solutions/zig/01-jm1/code
3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -24,4 +24,10 @@ pub fn build(b: *std.Build) void {
24
24
// This will evaluate the `run` step rather than the default, which is "install".
25
25
const run_step = b .step ("run" , "Run the app" );
26
26
run_step .dependOn (& run_cmd .step );
27
+
28
+ // This allows the user to pass arguments to the application in the build
29
+ // command itself, like this: `zig build run -- arg1 arg2 etc`
30
+ if (b .args ) | args | {
31
+ run_cmd .addArgs (args );
32
+ }
27
33
}
Original file line number Diff line number Diff line change @@ -24,4 +24,10 @@ pub fn build(b: *std.Build) void {
24
24
// This will evaluate the `run` step rather than the default, which is "install".
25
25
const run_step = b .step ("run" , "Run the app" );
26
26
run_step .dependOn (& run_cmd .step );
27
+
28
+ // This allows the user to pass arguments to the application in the build
29
+ // command itself, like this: `zig build run -- arg1 arg2 etc`
30
+ if (b .args ) | args | {
31
+ run_cmd .addArgs (args );
32
+ }
27
33
}
Original file line number Diff line number Diff line change @@ -24,4 +24,10 @@ pub fn build(b: *std.Build) void {
24
24
// This will evaluate the `run` step rather than the default, which is "install".
25
25
const run_step = b .step ("run" , "Run the app" );
26
26
run_step .dependOn (& run_cmd .step );
27
+
28
+ // This allows the user to pass arguments to the application in the build
29
+ // command itself, like this: `zig build run -- arg1 arg2 etc`
30
+ if (b .args ) | args | {
31
+ run_cmd .addArgs (args );
32
+ }
27
33
}
You can’t perform that action at this time.
0 commit comments