diff options
| author | 2020-11-10 18:34:18 +0100 | |
|---|---|---|
| committer | 2020-11-10 18:34:18 +0100 | |
| commit | cc871e7fbf4082fda4f4d1f150746f8090770408 (patch) | |
| tree | a9c9b623ae50f9c834d5f82896d9d2fe28a96db8 | |
| parent | Better parseParam (diff) | |
| parent | Better parseParam (diff) | |
| download | zig-clap-cc871e7fbf4082fda4f4d1f150746f8090770408.tar.gz zig-clap-cc871e7fbf4082fda4f4d1f150746f8090770408.tar.xz zig-clap-cc871e7fbf4082fda4f4d1f150746f8090770408.zip | |
Merge branch 'master' into zig-master
| -rw-r--r-- | .github/FUNDING.yml | 1 | ||||
| -rw-r--r-- | build.zig | 3 | ||||
| -rw-r--r-- | clap.zig | 4 |
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] | |||
| @@ -6,6 +6,7 @@ const Builder = std.build.Builder; | |||
| 6 | 6 | ||
| 7 | pub fn build(b: *Builder) void { | 7 | pub 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 | } |
| @@ -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 | } |