diff options
| -rw-r--r-- | README.org | 1 | ||||
| -rw-r--r-- | build.zig.zon | 17 | ||||
| -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 |
6 files changed, 15 insertions, 15 deletions
| @@ -25,6 +25,7 @@ newer (hopefully the newest!) Zig version that should enable you to compile the | |||
| 25 | | 0.12.0 | 0.4.0 | | 25 | | 0.12.0 | 0.4.0 | |
| 26 | | 0.12.1 | 0.4.0 | | 26 | | 0.12.1 | 0.4.0 | |
| 27 | | 0.13.0 | 0.5.0 | | 27 | | 0.13.0 | 0.5.0 | |
| 28 | | 0.14.0 | 0.6.0 | | ||
| 28 | | master | main | | 29 | | master | main | |
| 29 | 30 | ||
| 30 | * How | 31 | * How |
diff --git a/build.zig.zon b/build.zig.zon index f22e96a..53324aa 100644 --- a/build.zig.zon +++ b/build.zig.zon | |||
| @@ -1,22 +1,23 @@ | |||
| 1 | // -*- zig -*- | 1 | // -*- zig -*- |
| 2 | .{ | 2 | .{ |
| 3 | .name = "zup", | 3 | .name = .zup, |
| 4 | .version = "0.2.1", | 4 | .version = "0.6.0", |
| 5 | .fingerprint = 0xa46ac81bf4e1cf6e, | ||
| 5 | .paths = .{""}, | 6 | .paths = .{""}, |
| 6 | .dependencies = .{ | 7 | .dependencies = .{ |
| 7 | .clap = .{ | 8 | .clap = .{ |
| 8 | .url = "https://git.enes.lv/zig-clap/snapshot/zig-clap-7003678307b72bc25869308d7435a79114d1ac42.tar.xz", | 9 | .url = "https://git.enes.lv/zig-clap/snapshot/zig-clap-0.10.0.tar.xz", |
| 9 | .hash = "12208caa9e66620e2937cbd9d273e84dbab659c099bea8c985b3d46c2201f8d7c244", | 10 | .hash = "clap-0.10.0-oBajB434AQBDh-Ei3YtoKIRxZacVPF1iSwp3IX_ZB8f0", |
| 10 | }, | 11 | }, |
| 11 | .libarchive = .{ | 12 | .libarchive = .{ |
| 12 | // .path = "../zig-libarchive", | 13 | // .path = "../zig-libarchive", |
| 13 | .url = "https://git.enes.lv/zig-libarchive/snapshot/zig-libarchive-3d457c968af4ddcb3bc89965272b46fc2aa91452.tar.xz", | 14 | .url = "https://git.enes.lv/zig-libarchive/snapshot/zig-libarchive-0.4.1.tar.xz", |
| 14 | .hash = "1220c60a6aa308f9541fa460cb42a43c5e011ce141b52bd1e01fd8fac7e347edee60", | 15 | .hash = "N-V-__8AAEARAADGCmqjCPlUH6Rgy0KkPF4BHOFBtSvR4B_Y", |
| 15 | }, | 16 | }, |
| 16 | .xdg = .{ | 17 | .xdg = .{ |
| 17 | // .path = "../zig-xdg", | 18 | // .path = "../zig-xdg", |
| 18 | .url = "https://git.enes.lv/zig-xdg/snapshot/zig-xdg-7a1fe22046e374461c37fb232dca0a1a1733a532.tar.xz", | 19 | .url = "https://git.enes.lv/zig-xdg/snapshot/zig-xdg-0.5.0.tar.xz", |
| 19 | .hash = "12200288bfff905e157599e189cd44f14d34cbb544e2c126696dbbc71c5ddaf9058e", | 20 | .hash = "N-V-__8AAIIKAAACiL__kF4VdZnhic1E8U00y7VE4sEmaW27", |
| 20 | }, | 21 | }, |
| 21 | }, | 22 | }, |
| 22 | } | 23 | } |
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}`", |