add uname info to mzteinit

This commit is contained in:
LordMZTE 2022-09-09 16:57:33 +02:00
parent 551c33f37c
commit 66409997fd
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -21,16 +21,23 @@ pub fn main() !void {
fn ui(buf_writer: anytype) !run.Command {
const w = buf_writer.writer();
var style: ?at.style.Style = null;
try @import("figlet.zig").writeFiglet(w);
try w.writeAll(
\\
\\What do you want to do?
\\
\\
const uname = std.os.uname();
try updateStyle(w, .{ .foreground = .Yellow }, &style);
try w.print(
"\n {s} {s} {s}\n\n",
.{
uname.nodename,
uname.release,
uname.machine,
},
);
var style: ?at.style.Style = null;
try updateStyle(w, .{ .font_style = .{ .bold = true } }, &style);
try w.writeAll(" What do you want to do?\n\n");
for (std.enums.values(run.Command)) |tag| {
try updateStyle(w, .{ .foreground = .Cyan }, &style);
try w.print("[{c}] ", .{tag.char()});
@ -38,6 +45,7 @@ fn ui(buf_writer: anytype) !run.Command {
try w.print("{s}\n", .{@tagName(tag)});
}
try at.format.resetStyle(w);
style = .{};
try buf_writer.flush();