summaryrefslogtreecommitdiff
path: root/src/update.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/update.zig')
-rw-r--r--src/update.zig8
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 @@
1const std = @import("std"); 1const std = @import("std");
2const zup = @import("zup"); 2const zup = @import("zup");
3 3
4const Allocator = std.mem.Allocator; 4const Config = zup.Config;
5const Installation = zup.Installation; 5const 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.";
11pub const min_args = 0; 11pub const min_args = 0;
12pub const max_args = 0; 12pub const max_args = 0;
13 13
14pub fn main(comptime Result: type, allocator: Allocator, _: Result) !void { 14pub 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();