riverctl, rivertile: don't forget to flush()
This commit is contained in:
@@ -89,14 +89,17 @@ fn _main(init: std.process.Init.Minimal) !void {
|
|||||||
.{ .name = "version", .kind = .boolean },
|
.{ .name = "version", .kind = .boolean },
|
||||||
}).parse(args[1..]) catch {
|
}).parse(args[1..]) catch {
|
||||||
try stderr.writeAll(usage);
|
try stderr.writeAll(usage);
|
||||||
|
try stderr.flush();
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
};
|
};
|
||||||
if (result.flags.h) {
|
if (result.flags.h) {
|
||||||
try stdout.writeAll(usage);
|
try stdout.writeAll(usage);
|
||||||
|
try stdout.flush();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
if (result.flags.version) {
|
if (result.flags.version) {
|
||||||
try stdout.writeAll(@import("build_options").version ++ "\n");
|
try stdout.writeAll(@import("build_options").version ++ "\n");
|
||||||
|
try stdout.flush();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,6 +152,7 @@ fn callbackListener(_: *zriver.CommandCallbackV1, event: zriver.CommandCallbackV
|
|||||||
if (mem.orderZ(u8, failure.failure_message, "unknown command") == .eq) {
|
if (mem.orderZ(u8, failure.failure_message, "unknown command") == .eq) {
|
||||||
std.log.err("unknown command", .{});
|
std.log.err("unknown command", .{});
|
||||||
stderr.writeAll(usage) catch {};
|
stderr.writeAll(usage) catch {};
|
||||||
|
stderr.flush() catch {};
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
fatal("{s}", .{failure.failure_message});
|
fatal("{s}", .{failure.failure_message});
|
||||||
|
|||||||
@@ -332,16 +332,19 @@ pub fn main(init: std.process.Init.Minimal) !void {
|
|||||||
.{ .name = "main-ratio", .kind = .arg },
|
.{ .name = "main-ratio", .kind = .arg },
|
||||||
}).parse(args[1..]) catch {
|
}).parse(args[1..]) catch {
|
||||||
try stderr.writeAll(usage);
|
try stderr.writeAll(usage);
|
||||||
|
try stderr.flush();
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
};
|
};
|
||||||
if (result.flags.h) {
|
if (result.flags.h) {
|
||||||
try stdout.writeAll(usage);
|
try stdout.writeAll(usage);
|
||||||
|
try stdout.flush();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
if (result.args.len != 0) fatalPrintUsage("unknown option '{s}'", .{result.args[0]});
|
if (result.args.len != 0) fatalPrintUsage("unknown option '{s}'", .{result.args[0]});
|
||||||
|
|
||||||
if (result.flags.version) {
|
if (result.flags.version) {
|
||||||
try stdout.writeAll(@import("build_options").version ++ "\n");
|
try stdout.writeAll(@import("build_options").version ++ "\n");
|
||||||
|
try stdout.flush();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
if (result.flags.@"view-padding") |raw| {
|
if (result.flags.@"view-padding") |raw| {
|
||||||
|
|||||||
Reference in New Issue
Block a user