From 32d35cdf91f7ff31070e844785adbd33febef229 Mon Sep 17 00:00:00 2001 From: novakane Date: Sat, 24 Jul 2021 11:31:17 +0200 Subject: Add -version flag to river, riverctl and rivertile --- riverctl/main.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'riverctl') diff --git a/riverctl/main.zig b/riverctl/main.zig index 9d4c8b6..31ca44e 100644 --- a/riverctl/main.zig +++ b/riverctl/main.zig @@ -61,9 +61,15 @@ fn _main() !void { const control = globals.control orelse return error.RiverControlNotAdvertised; const seat = globals.seat orelse return error.SeatNotAdverstised; - // Skip our name, send all other args // This next line is needed cause of https://github.com/ziglang/zig/issues/2622 const args = os.argv; + + if (mem.eql(u8, mem.span(args[1]), "-version")) { + try std.io.getStdOut().writeAll(@import("build_options").version); + std.os.exit(0); + } + + // Skip our name, send all other args for (args[1..]) |arg| control.addArgument(arg); const callback = try control.runCommand(seat); -- cgit v1.2.3