summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2024-10-24 17:40:56 +0200
committerGravatar Komari Spaghetti2024-10-24 17:45:01 +0200
commit281090c23ca631d8811d7ccb2a0dcdf4ef72a7b1 (patch)
tree0faafb2b82ddd85ddc824332310be23660c5867c /build.zig
parentfeat: Support multiple positionals of different types (diff)
downloadzig-clap-281090c23ca631d8811d7ccb2a0dcdf4ef72a7b1.tar.gz
zig-clap-281090c23ca631d8811d7ccb2a0dcdf4ef72a7b1.tar.xz
zig-clap-281090c23ca631d8811d7ccb2a0dcdf4ef72a7b1.zip
docs: Add subcommand example
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/build.zig b/build.zig
index b4a8e91..3b88e47 100644
--- a/build.zig
+++ b/build.zig
@@ -15,10 +15,11 @@ pub fn build(b: *std.Build) void {
15 15
16 const example_step = b.step("examples", "Build examples"); 16 const example_step = b.step("examples", "Build examples");
17 for ([_][]const u8{ 17 for ([_][]const u8{
18 "help",
18 "simple", 19 "simple",
19 "simple-ex", 20 "simple-ex",
20 "streaming-clap", 21 "streaming-clap",
21 "help", 22 "subcommands",
22 "usage", 23 "usage",
23 }) |example_name| { 24 }) |example_name| {
24 const example = b.addExecutable(.{ 25 const example = b.addExecutable(.{
@@ -69,6 +70,7 @@ fn readMeStep(b: *std.Build) *std.Build.Step {
69 try stream.print(@embedFile("example/README.md.template"), .{ 70 try stream.print(@embedFile("example/README.md.template"), .{
70 @embedFile("example/simple.zig"), 71 @embedFile("example/simple.zig"),
71 @embedFile("example/simple-ex.zig"), 72 @embedFile("example/simple-ex.zig"),
73 @embedFile("example/subcommands.zig"),
72 @embedFile("example/streaming-clap.zig"), 74 @embedFile("example/streaming-clap.zig"),
73 @embedFile("example/help.zig"), 75 @embedFile("example/help.zig"),
74 @embedFile("example/usage.zig"), 76 @embedFile("example/usage.zig"),