| 1 | const std = @import("std"); |
| 2 | |
| 3 | pub fn main(init: std.process.Init) !void { |
| 4 | const arena = init.arena.allocator(); |
| 5 | const args = try init.minimal.args.toSlice(arena); |
| 6 | const io = init.io; |
| 7 | const cwd_path = try std.process.currentPathAlloc(io, arena); |
| 8 | |
| 9 | if (args.len < 3) return error.MissingArgs; |
| 10 | |
| 11 | const relative = try std.fs.path.relative(arena, cwd_path, init.environ_map, args[1], args[2]); |
| 12 | |
| 13 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); |
| 14 | const stdout = &stdout_writer.interface; |
| 15 | try stdout.writeAll(relative); |
| 16 | } |