| author | |
| committer | |
| log | 4a03000239d5e05062cf9344a08e0dc43ad8ebd1 |
| tree | b658ca038bfaece9d29bd503a12be1802ecc433b |
| parent | 05a5b3ad0037289b8338807dcf2963e5b3e4b753 |
1 files changed, 6 insertions(+), 0 deletions(-)
src/lib.zig+6| ... | ... | @@ -117,3 +117,9 @@ pub fn getMulti(name: string) ?[]const string { |
| 117 | 117 | const x = multis.get(name).?.items; |
| 118 | 118 | return if (x.len > 0) x else null; |
| 119 | 119 | } |
| 120 | ||
| 121 | pub fn getBool(name: string, default: bool) !bool { | |
| 122 | const x = getSingle(name) orelse return default; | |
| 123 | const y = try std.fmt.parseUnsigned(u1, x, 2); | |
| 124 | return y > 0; | |
| 125 | } |