summaryrefslogtreecommitdiff
path: root/clap.zig
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2018-11-13 13:33:51 +0100
committerGravatar Jimmi Holst Christensen2018-11-13 13:33:51 +0100
commit9e2ac9c6ab567ab3d95db9527147ef80aa4dd7c1 (patch)
treeaaba4173edfbc925068393c1d417da2b618bea53 /clap.zig
parentRun tests in all release modes (diff)
downloadzig-clap-9e2ac9c6ab567ab3d95db9527147ef80aa4dd7c1.tar.gz
zig-clap-9e2ac9c6ab567ab3d95db9527147ef80aa4dd7c1.tar.xz
zig-clap-9e2ac9c6ab567ab3d95db9527147ef80aa4dd7c1.zip
Zig fmt
Diffstat (limited to 'clap.zig')
-rw-r--r--clap.zig25
1 files changed, 1 insertions, 24 deletions
diff --git a/clap.zig b/clap.zig
index 26b97aa..a2d30a5 100644
--- a/clap.zig
+++ b/clap.zig
@@ -210,7 +210,7 @@ pub const OsArgIterator = struct {
210/// ::StreamingClap.next to parse all the arguments of your program. 210/// ::StreamingClap.next to parse all the arguments of your program.
211pub fn StreamingClap(comptime Id: type, comptime ArgError: type) type { 211pub fn StreamingClap(comptime Id: type, comptime ArgError: type) type {
212 return struct { 212 return struct {
213 const Self = @This(); 213 const Self = @This();
214 214
215 const State = union(enum) { 215 const State = union(enum) {
216 Normal, 216 Normal,
@@ -374,26 +374,3 @@ pub fn StreamingClap(comptime Id: type, comptime ArgError: type) type {
374 } 374 }
375 }; 375 };
376} 376}
377
378pub fn ToStructId(comptime T: type) type {
379 return struct {
380 parse: fn(*T, ?[]const u8)
381 };
382}
383
384const ToStructParamError = error{};
385const ToStructParam = Param(fn (*T, ?[]const u8) ToStructParamError!void);
386
387fn paramsFromStruct(comptime T: type) []const ToStructParam {
388 var res: []const ToStructParam = []ToStructParam{};
389
390 for (@typeInfo(T).Struct.fields) |field| {
391 res = res ++ []ToStructParam{
392 ToStructParam.init()
393 };
394 }
395}
396
397pub fn toStruct(defaults: var, iter: *ArgIterator(ArgError)) !@typeOf(defaults) {
398
399}