diff options
Diffstat (limited to 'src/install.zig')
| -rw-r--r-- | src/install.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/install.zig b/src/install.zig index ebf1c01..f9c7309 100644 --- a/src/install.zig +++ b/src/install.zig | |||
| @@ -5,6 +5,7 @@ const xdg = @import("xdg"); | |||
| 5 | const zup = @import("zup"); | 5 | const zup = @import("zup"); |
| 6 | 6 | ||
| 7 | const Allocator = std.mem.Allocator; | 7 | const Allocator = std.mem.Allocator; |
| 8 | const Config = zup.Config; | ||
| 8 | const ArchiveRead = libarchive.Read; | 9 | const ArchiveRead = libarchive.Read; |
| 9 | const Installation = zup.Installation; | 10 | const Installation = zup.Installation; |
| 10 | const Installations = zup.Installations; | 11 | const Installations = zup.Installations; |
| @@ -17,8 +18,10 @@ pub const description = "Installs a Zig version. Run `zup list -i` to see insta | |||
| 17 | pub const min_args = 1; | 18 | pub const min_args = 1; |
| 18 | pub const max_args = 1; | 19 | pub const max_args = 1; |
| 19 | 20 | ||
| 20 | pub fn main(comptime Result: type, allocator: Allocator, res: Result) !void { | 21 | pub fn main(comptime Result: type, config: Config, res: Result) !void { |
| 21 | var available = try Installation.getAvailableList(allocator); | 22 | const allocator = config.allocator; |
| 23 | |||
| 24 | var available = try Installation.getAvailableList(config); | ||
| 22 | defer Installation.deinitMap(allocator, &available); | 25 | defer Installation.deinitMap(allocator, &available); |
| 23 | 26 | ||
| 24 | return perform(allocator, res.positionals[0], res.args.force, available); | 27 | return perform(allocator, res.positionals[0], res.args.force, available); |