| ... | @@ -13,6 +13,7 @@ pub fn main() !void { | ... | @@ -13,6 +13,7 @@ pub fn main() !void { |
| 13 | | 13 | |
| 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); |
| 16 | | 17 | |
| 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 | } |