diff options
| author | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2024-02-28 21:57:07 -0800 |
|---|---|---|
| committer | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2024-03-22 20:27:31 -0700 |
| commit | 0c888af4709eacf99bd67c002316968db616abc2 (patch) | |
| tree | d579340589464c3ca1fa4ae2e07e9c96348c71dc /src/cli | |
| parent | 2725b7d9b2572185e6a45077087c1b6b1fe2dff6 (diff) | |
cli: arg parsing supports more int types
Diffstat (limited to 'src/cli')
| -rw-r--r-- | src/cli/args.zig | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/cli/args.zig b/src/cli/args.zig index 0363ba9be..49c5152ac 100644 --- a/src/cli/args.zig +++ b/src/cli/args.zig @@ -234,20 +234,18 @@ fn parseIntoField( bool => try parseBool(value orelse "t"), - u8 => std.fmt.parseInt( - u8, - value orelse return error.ValueRequired, - 0, - ) catch return error.InvalidValue, - - u32 => std.fmt.parseInt( - u32, - value orelse return error.ValueRequired, - 0, - ) catch return error.InvalidValue, - - u64 => std.fmt.parseInt( - u64, + inline u8, + u16, + u32, + u64, + usize, + i8, + i16, + i32, + i64, + isize, + => |Int| std.fmt.parseInt( + Int, value orelse return error.ValueRequired, 0, ) catch return error.InvalidValue, |
