| ... | ... | @@ -121,17 +121,18 @@ fn fixNameForEnv(alloc: std.mem.Allocator, input: string) ![:0]const u8 { |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | pub fn getSingle(name: string) ?string { |
| 124 | | const x = singles.get(name).?; |
| 124 | const x = singles.get(name) orelse return null; |
| 125 | 125 | return if (x.len > 0) x else null; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | pub fn getMulti(name: string) ?[]const string { |
| 129 | | const x = multis.get(name).?.items; |
| 129 | const x = (multis.get(name) orelse return null).items; |
| 130 | 130 | return if (x.len > 0) x else null; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | pub fn getBool(name: string, default: bool) !bool { |
| 134 | 134 | const x = getSingle(name) orelse return default; |
| 135 | | const y = try extras.parseDigits(u1, x, 2); |
| 135 | if (std.mem.eql(u8, x, "true")) return true; |
| 136 | const y = extras.parseDigits(u1, x, 2) catch return default; |
| 136 | 137 | return y > 0; |
| 137 | 138 | } |