summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar joachimschmidt5572020-07-13 20:25:42 +0200
committerGravatar joachimschmidt5572020-07-13 20:25:42 +0200
commitea5193a2c300a1d0daf42f7208e7b9c3de132ad4 (patch)
tree0ff59a8184732f7b47c473e30302116b1230bdb3
parentRun zig fmt on build (diff)
downloadzig-clap-ea5193a2c300a1d0daf42f7208e7b9c3de132ad4.tar.gz
zig-clap-ea5193a2c300a1d0daf42f7208e7b9c3de132ad4.tar.xz
zig-clap-ea5193a2c300a1d0daf42f7208e7b9c3de132ad4.zip
update to latest zig
var -> anytype
-rw-r--r--clap.zig20
1 files changed, 10 insertions, 10 deletions
diff --git a/clap.zig b/clap.zig
index ff423cc..204494b 100644
--- a/clap.zig
+++ b/clap.zig
@@ -276,11 +276,11 @@ pub fn parse(
276/// --long helpText 276/// --long helpText
277/// --long <valueText> helpText 277/// --long <valueText> helpText
278pub fn helpFull( 278pub fn helpFull(
279 stream: var, 279 stream: anytype,
280 comptime Id: type, 280 comptime Id: type,
281 params: []const Param(Id), 281 params: []const Param(Id),
282 comptime Error: type, 282 comptime Error: type,
283 context: var, 283 context: anytype,
284 helpText: fn (@TypeOf(context), Param(Id)) Error![]const u8, 284 helpText: fn (@TypeOf(context), Param(Id)) Error![]const u8,
285 valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, 285 valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8,
286) !void { 286) !void {
@@ -309,11 +309,11 @@ pub fn helpFull(
309} 309}
310 310
311fn printParam( 311fn printParam(
312 stream: var, 312 stream: anytype,
313 comptime Id: type, 313 comptime Id: type,
314 param: Param(Id), 314 param: Param(Id),
315 comptime Error: type, 315 comptime Error: type,
316 context: var, 316 context: anytype,
317 valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, 317 valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8,
318) !void { 318) !void {
319 if (param.names.short) |s| { 319 if (param.names.short) |s| {
@@ -337,7 +337,7 @@ fn printParam(
337/// A wrapper around helpFull for simple helpText and valueText functions that 337/// A wrapper around helpFull for simple helpText and valueText functions that
338/// cant return an error or take a context. 338/// cant return an error or take a context.
339pub fn helpEx( 339pub fn helpEx(
340 stream: var, 340 stream: anytype,
341 comptime Id: type, 341 comptime Id: type,
342 params: []const Param(Id), 342 params: []const Param(Id),
343 helpText: fn (Param(Id)) []const u8, 343 helpText: fn (Param(Id)) []const u8,
@@ -376,7 +376,7 @@ pub const Help = struct {
376}; 376};
377 377
378/// A wrapper around helpEx that takes a Param(Help). 378/// A wrapper around helpEx that takes a Param(Help).
379pub fn help(stream: var, params: []const Param(Help)) !void { 379pub fn help(stream: anytype, params: []const Param(Help)) !void {
380 try helpEx(stream, Help, params, getHelpSimple, getValueSimple); 380 try helpEx(stream, Help, params, getHelpSimple, getValueSimple);
381} 381}
382 382
@@ -443,11 +443,11 @@ test "clap.help" {
443/// First all none value taking parameters, which have a short name are 443/// First all none value taking parameters, which have a short name are
444/// printed, then non positional parameters and finally the positinal. 444/// printed, then non positional parameters and finally the positinal.
445pub fn usageFull( 445pub fn usageFull(
446 stream: var, 446 stream: anytype,
447 comptime Id: type, 447 comptime Id: type,
448 params: []const Param(Id), 448 params: []const Param(Id),
449 comptime Error: type, 449 comptime Error: type,
450 context: var, 450 context: anytype,
451 valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, 451 valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8,
452) !void { 452) !void {
453 var cos = io.countingOutStream(stream); 453 var cos = io.countingOutStream(stream);
@@ -497,7 +497,7 @@ pub fn usageFull(
497/// A wrapper around usageFull for a simple valueText functions that 497/// A wrapper around usageFull for a simple valueText functions that
498/// cant return an error or take a context. 498/// cant return an error or take a context.
499pub fn usageEx( 499pub fn usageEx(
500 stream: var, 500 stream: anytype,
501 comptime Id: type, 501 comptime Id: type,
502 params: []const Param(Id), 502 params: []const Param(Id),
503 valueText: fn (Param(Id)) []const u8, 503 valueText: fn (Param(Id)) []const u8,
@@ -521,7 +521,7 @@ pub fn usageEx(
521} 521}
522 522
523/// A wrapper around usageEx that takes a Param(Help). 523/// A wrapper around usageEx that takes a Param(Help).
524pub fn usage(stream: var, params: []const Param(Help)) !void { 524pub fn usage(stream: anytype, params: []const Param(Help)) !void {
525 try usageEx(stream, Help, params, getValueSimple); 525 try usageEx(stream, Help, params, getValueSimple);
526} 526}
527 527