From bf6f10e50bd431a51359fb5fe6e97e703d9cc1d5 Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Thu, 16 Apr 2020 22:54:31 -0400 Subject: [PATCH] Updated FAQ (markdown) --- FAQ.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/FAQ.md b/FAQ.md index 5c3452d..6cf77b1 100644 --- a/FAQ.md +++ b/FAQ.md @@ -134,9 +134,12 @@ You can also pass `-fno-sanitize=undefined`. ## How to add command-line args to `zig build run` sub-command? -in `build.zig`... +#### usage +```sh +zig build run -- one two three +``` -#### `zig build run -- one two three` +#### edit `build.zig` ```zig const run_cmd = exe.run(); if (b.args) |args| run_cmd.addArgs(args); @@ -144,10 +147,13 @@ if (b.args) |args| run_cmd.addArgs(args); ## How to tie a `zig build run` sub-command to custom `-D` style options -in `build.zig`... +#### usage +```sh +zig build run -Dhello=false +zig build run -Dhello=true +``` -#### `zig build run -Dhello=false` -#### `zig build run -Dhello=true` +#### edit `build.zig` ```zig exe.addBuildOption(bool, "hello", hello); ```