diff options
| author | 2025-07-22 05:56:17 +0300 | |
|---|---|---|
| committer | 2025-07-22 05:56:17 +0300 | |
| commit | a43867dd7d02937a233a039eec7c7f43977b0b0c (patch) | |
| tree | 1fe7487f67df24ed4c42251da81f35320ed2b9fa /src | |
| parent | Update zig (diff) | |
| download | zup-a43867dd7d02937a233a039eec7c7f43977b0b0c.tar.gz zup-a43867dd7d02937a233a039eec7c7f43977b0b0c.tar.xz zup-a43867dd7d02937a233a039eec7c7f43977b0b0c.zip | |
Release 0.6.00.6.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/install.zig | 2 | ||||
| -rw-r--r-- | src/main.zig | 6 | ||||
| -rw-r--r-- | src/remove.zig | 2 | ||||
| -rw-r--r-- | src/switch.zig | 2 |
4 files changed, 5 insertions, 7 deletions
diff --git a/src/install.zig b/src/install.zig index de6d8f0..8a16e49 100644 --- a/src/install.zig +++ b/src/install.zig | |||
| @@ -25,7 +25,7 @@ pub fn main(comptime Result: type, config: Config, res: Result) !void { | |||
| 25 | var available = try Installation.getAvailableList(config); | 25 | var available = try Installation.getAvailableList(config); |
| 26 | defer Installation.deinitMap(allocator, &available); | 26 | defer Installation.deinitMap(allocator, &available); |
| 27 | 27 | ||
| 28 | return perform(allocator, res.positionals[0], res.args.force != 0, available); | 28 | return perform(allocator, res.positionals[0].?, res.args.force != 0, available); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | pub fn perform(allocator: Allocator, name: []const u8, force: bool, available: Installations) !void { | 31 | pub fn perform(allocator: Allocator, name: []const u8, force: bool, available: Installations) !void { |
diff --git a/src/main.zig b/src/main.zig index 0fe6f16..c7e3844 100644 --- a/src/main.zig +++ b/src/main.zig | |||
| @@ -99,11 +99,9 @@ const Help = struct { | |||
| 99 | pub const max_args = 1; | 99 | pub const max_args = 1; |
| 100 | 100 | ||
| 101 | pub fn main(comptime Result: type, _: Config, res: Result) !void { | 101 | pub fn main(comptime Result: type, _: Config, res: Result) !void { |
| 102 | if (res.positionals.len == 0) { | 102 | const cmd = res.positionals[0] orelse { |
| 103 | return mainHelp(); | 103 | return mainHelp(); |
| 104 | } | 104 | }; |
| 105 | |||
| 106 | const cmd = res.positionals[0]; | ||
| 107 | return dispatch(cmd, "help", unknownHelp, .{cmd}); | 105 | return dispatch(cmd, "help", unknownHelp, .{cmd}); |
| 108 | } | 106 | } |
| 109 | 107 | ||
diff --git a/src/remove.zig b/src/remove.zig index bc5b06a..fb53d06 100644 --- a/src/remove.zig +++ b/src/remove.zig | |||
| @@ -16,7 +16,7 @@ pub const max_args = 1; | |||
| 16 | pub fn main(comptime Result: type, config: Config, res: Result) !void { | 16 | pub fn main(comptime Result: type, config: Config, res: Result) !void { |
| 17 | const allocator = config.allocator; | 17 | const allocator = config.allocator; |
| 18 | 18 | ||
| 19 | const name = res.positionals[0]; | 19 | const name = res.positionals[0].?; |
| 20 | 20 | ||
| 21 | if (!try Installation.isInstalled(allocator, name)) { | 21 | if (!try Installation.isInstalled(allocator, name)) { |
| 22 | std.log.err("{s} is not installed!", .{name}); | 22 | std.log.err("{s} is not installed!", .{name}); |
diff --git a/src/switch.zig b/src/switch.zig index 3323332..891c4e0 100644 --- a/src/switch.zig +++ b/src/switch.zig | |||
| @@ -13,7 +13,7 @@ pub const max_args = 1; | |||
| 13 | pub fn main(comptime Result: type, config: Config, res: Result) !void { | 13 | pub fn main(comptime Result: type, config: Config, res: Result) !void { |
| 14 | const allocator = config.allocator; | 14 | const allocator = config.allocator; |
| 15 | 15 | ||
| 16 | const name = res.positionals[0]; | 16 | const name = res.positionals[0].?; |
| 17 | if (!try Installation.isInstalled(allocator, name)) { | 17 | if (!try Installation.isInstalled(allocator, name)) { |
| 18 | std.log.err( | 18 | std.log.err( |
| 19 | "No installation by name {s} found, run `zup install {s}`", | 19 | "No installation by name {s} found, run `zup install {s}`", |