diff options
| author | novakane <mail@novakane.xyz> | 2021-07-24 11:31:17 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2021-07-24 14:14:53 +0000 |
| commit | 32d35cdf91f7ff31070e844785adbd33febef229 (patch) | |
| tree | f0d8fccb9e8a4ee934b5529e0c28a2bf9eb66a38 /riverctl/main.zig | |
| parent | 9c633a78886eec86337438b2e3d4189197257464 (diff) | |
| download | river-32d35cdf91f7ff31070e844785adbd33febef229.tar.gz river-32d35cdf91f7ff31070e844785adbd33febef229.tar.xz | |
Add -version flag to river, riverctl and rivertile
Diffstat (limited to 'riverctl/main.zig')
| -rw-r--r-- | riverctl/main.zig | 8 |
1 files changed, 7 insertions, 1 deletions
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); |
