authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-11-24 00:17:38 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-11-24 00:17:38 -08:00
loga1ea508279920f457c5f899022046fefd6dc146a
tree18a61448a154d414dda00f8b5195c6057203abea
parent09d633b1405c5cbd4e02f4c86cb34f0368bf321f

main: pass proper self_path value


1 files changed, 2 insertions(+), 1 deletions(-)

src/main.zig+2-1
...@@ -13,6 +13,7 @@ pub fn main() !void {...@@ -13,6 +13,7 @@ pub fn main() !void {
1313
14 const proc_args = try std.process.argsAlloc(gpa);14 const proc_args = try std.process.argsAlloc(gpa);
15 const args = proc_args[1..];15 const args = proc_args[1..];
16 const self_path = try std.fs.selfExePathAlloc(gpa);
1617
17 if (args.len == 0) {18 if (args.len == 0) {
18 std.debug.print("zigmod {s} {s} {s} {s}\n", .{19 std.debug.print("zigmod {s} {s} {s} {s}\n", .{
...@@ -45,7 +46,7 @@ pub fn main() !void {...@@ -45,7 +46,7 @@ pub fn main() !void {
45 inline for (comptime std.meta.declarations(zigmod.commands)) |decl| {46 inline for (comptime std.meta.declarations(zigmod.commands)) |decl| {
46 if (std.mem.eql(u8, args[0], decl.name)) {47 if (std.mem.eql(u8, args[0], decl.name)) {
47 const cmd = @field(zigmod.commands, decl.name);48 const cmd = @field(zigmod.commands, decl.name);
48 try cmd.execute(proc_args[0], args[1..]);49 try cmd.execute(self_path, args[1..]);
49 return;50 return;
50 }51 }
51 }52 }