| author | |
| committer | |
| log | d05d189fe2710c39746dc1ecbe3010c615f58b92 |
| tree | 4c447618394616b895b2eb82625dd9d7b0170b6e |
| parent | d4e2c02bb7cd1a8e23fa2b777fa281d69e6b5851 |
1 files changed, 4 insertions(+), 0 deletions(-)
src/lib.zig+4| ... | ... | @@ -519,3 +519,7 @@ pub fn parse_int(comptime T: type, s: ?string, b: u8, d: T) T { |
| 519 | 519 | if (s == null) return d; |
| 520 | 520 | return std.fmt.parseInt(T, s.?, b) catch d; |
| 521 | 521 | } |
| 522 | ||
| 523 | pub fn parse_bool(s: ?string) bool { | |
| 524 | return parse_int(u1, s, 10, 0) > 0; | |
| 525 | } |