summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2020-11-10 18:34:18 +0100
committerGravatar Jimmi Holst Christensen2020-11-10 18:34:18 +0100
commitcc871e7fbf4082fda4f4d1f150746f8090770408 (patch)
treea9c9b623ae50f9c834d5f82896d9d2fe28a96db8
parentBetter parseParam (diff)
parentBetter parseParam (diff)
downloadzig-clap-cc871e7fbf4082fda4f4d1f150746f8090770408.tar.gz
zig-clap-cc871e7fbf4082fda4f4d1f150746f8090770408.tar.xz
zig-clap-cc871e7fbf4082fda4f4d1f150746f8090770408.zip
Merge branch 'master' into zig-master
-rw-r--r--.github/FUNDING.yml1
-rw-r--r--build.zig3
-rw-r--r--clap.zig4
3 files changed, 6 insertions, 2 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000..2b7106c
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
github: [Hejsil]
diff --git a/build.zig b/build.zig
index 8ecc3f3..9baf1d4 100644
--- a/build.zig
+++ b/build.zig
@@ -6,6 +6,7 @@ const Builder = std.build.Builder;
6 6
7pub fn build(b: *Builder) void { 7pub fn build(b: *Builder) void {
8 const mode = b.standardReleaseOptions(); 8 const mode = b.standardReleaseOptions();
9 const target = b.standardTargetOptions(.{});
9 10
10 const fmt_step = b.addFmt(&[_][]const u8{ 11 const fmt_step = b.addFmt(&[_][]const u8{
11 "build.zig", 12 "build.zig",
@@ -20,6 +21,7 @@ pub fn build(b: *Builder) void {
20 21
21 const tests = b.addTest("clap.zig"); 22 const tests = b.addTest("clap.zig");
22 tests.setBuildMode(test_mode); 23 tests.setBuildMode(test_mode);
24 tests.setTarget(target);
23 tests.setNamePrefix(mode_str ++ " "); 25 tests.setNamePrefix(mode_str ++ " ");
24 26
25 const test_step = b.step("test-" ++ mode_str, "Run all tests in " ++ mode_str ++ "."); 27 const test_step = b.step("test-" ++ mode_str, "Run all tests in " ++ mode_str ++ ".");
@@ -39,6 +41,7 @@ pub fn build(b: *Builder) void {
39 const example = b.addExecutable(example_name, "example/" ++ example_name ++ ".zig"); 41 const example = b.addExecutable(example_name, "example/" ++ example_name ++ ".zig");
40 example.addPackagePath("clap", "clap.zig"); 42 example.addPackagePath("clap", "clap.zig");
41 example.setBuildMode(mode); 43 example.setBuildMode(mode);
44 example.setTarget(target);
42 example.install(); 45 example.install();
43 example_step.dependOn(&example.step); 46 example_step.dependOn(&example.step);
44 } 47 }
diff --git a/clap.zig b/clap.zig
index 209b58f..8624c88 100644
--- a/clap.zig
+++ b/clap.zig
@@ -368,7 +368,7 @@ pub fn helpFull(
368 var counting_stream = io.countingOutStream(io.null_out_stream); 368 var counting_stream = io.countingOutStream(io.null_out_stream);
369 try printParam(counting_stream.outStream(), Id, param, Error, context, valueText); 369 try printParam(counting_stream.outStream(), Id, param, Error, context, valueText);
370 if (res < counting_stream.bytes_written) 370 if (res < counting_stream.bytes_written)
371 res = counting_stream.bytes_written; 371 res = @intCast(usize, counting_stream.bytes_written);
372 } 372 }
373 373
374 break :blk res; 374 break :blk res;
@@ -381,7 +381,7 @@ pub fn helpFull(
381 var counting_stream = io.countingOutStream(stream); 381 var counting_stream = io.countingOutStream(stream);
382 try stream.print("\t", .{}); 382 try stream.print("\t", .{});
383 try printParam(counting_stream.outStream(), Id, param, Error, context, valueText); 383 try printParam(counting_stream.outStream(), Id, param, Error, context, valueText);
384 try stream.writeByteNTimes(' ', max_spacing - counting_stream.bytes_written); 384 try stream.writeByteNTimes(' ', max_spacing - @intCast(usize, counting_stream.bytes_written));
385 try stream.print("\t{}\n", .{try helpText(context, param)}); 385 try stream.print("\t{}\n", .{try helpText(context, param)});
386 } 386 }
387} 387}