diff options
Diffstat (limited to 'src/update.zig')
| -rw-r--r-- | src/update.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/update.zig b/src/update.zig index a8fd075..3451d90 100644 --- a/src/update.zig +++ b/src/update.zig | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const zup = @import("zup"); | 2 | const zup = @import("zup"); |
| 3 | 3 | ||
| 4 | const Allocator = std.mem.Allocator; | 4 | const Config = zup.Config; |
| 5 | const Installation = zup.Installation; | 5 | const Installation = zup.Installation; |
| 6 | 6 | ||
| 7 | // TODO: A way to specify a subset? | 7 | // TODO: A way to specify a subset? |
| @@ -11,11 +11,13 @@ pub const description = "Updates all installed Zig versions."; | |||
| 11 | pub const min_args = 0; | 11 | pub const min_args = 0; |
| 12 | pub const max_args = 0; | 12 | pub const max_args = 0; |
| 13 | 13 | ||
| 14 | pub fn main(comptime Result: type, allocator: Allocator, _: Result) !void { | 14 | pub fn main(comptime Result: type, config: Config, _: Result) !void { |
| 15 | const allocator = config.allocator; | ||
| 16 | |||
| 15 | var installed = try Installation.getInstalledList(allocator); | 17 | var installed = try Installation.getInstalledList(allocator); |
| 16 | defer Installation.deinitMap(allocator, &installed); | 18 | defer Installation.deinitMap(allocator, &installed); |
| 17 | 19 | ||
| 18 | var available = try Installation.getAvailableList(allocator); | 20 | var available = try Installation.getAvailableList(config); |
| 19 | defer Installation.deinitMap(allocator, &available); | 21 | defer Installation.deinitMap(allocator, &available); |
| 20 | 22 | ||
| 21 | var it = installed.iterator(); | 23 | var it = installed.iterator(); |