From 48b3ba6bd0eed040749bd3addaeb6a3614183e68 Mon Sep 17 00:00:00 2001 From: Uzair Aftab Date: Thu, 3 Oct 2024 21:55:14 +0200 Subject: [PATCH] cli: Add in easter egg with ascii art from @rednur01 Co-authored-by: Zabir Nur <41484948+rednur01@users.noreply.github.com> --- src/cli/action.zig | 5 +++++ src/cli/boo.zig | 15 +++++++++++++++ src/cli/ghost_ascii.txt | 12 ++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 src/cli/boo.zig create mode 100644 src/cli/ghost_ascii.txt diff --git a/src/cli/action.zig b/src/cli/action.zig index 950577158..88715d559 100644 --- a/src/cli/action.zig +++ b/src/cli/action.zig @@ -12,6 +12,7 @@ const list_actions = @import("list_actions.zig"); const show_config = @import("show_config.zig"); const validate_config = @import("validate_config.zig"); const crash_report = @import("crash_report.zig"); +const boo = @import("boo.zig"); /// Special commands that can be invoked via CLI flags. These are all /// invoked by using `+` as a CLI flag. The only exception is @@ -47,6 +48,9 @@ pub const Action = enum { // List, (eventually) view, and (eventually) send crash reports. @"crash-report", + // 👻 + boo, + pub const Error = error{ /// Multiple actions were detected. You can specify at most one /// action on the CLI otherwise the behavior desired is ambiguous. @@ -139,6 +143,7 @@ pub const Action = enum { .@"show-config" => try show_config.run(alloc), .@"validate-config" => try validate_config.run(alloc), .@"crash-report" => try crash_report.run(alloc), + .boo => try boo.run(alloc), }; } diff --git a/src/cli/boo.zig b/src/cli/boo.zig new file mode 100644 index 000000000..199c30240 --- /dev/null +++ b/src/cli/boo.zig @@ -0,0 +1,15 @@ +const std = @import("std"); + +const Allocator = std.mem.Allocator; + +const GHOST_ASCII_ART = @embedFile("ghost_ascii.txt"); + +/// Spooky time +pub fn run(alloc: Allocator) !u8 { + _ = alloc; + const stdout = std.io.getStdOut().writer(); + + try stdout.writeAll(GHOST_ASCII_ART); + + return 0; +} diff --git a/src/cli/ghost_ascii.txt b/src/cli/ghost_ascii.txt new file mode 100644 index 000000000..bccb6d1cf --- /dev/null +++ b/src/cli/ghost_ascii.txt @@ -0,0 +1,12 @@ +⠀⠀⠀⠀⣠⣴⣶⣿⣿⣿⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⢀⣾⣿⣿⣿⡿⠟⠿⢿⣿⣿⣿⡿⠟⠿⢿⣿⣿⣿⡄ ⠀ +⣼⣿⣿⣿⡏⠀⠀⠀⠀⢻⣿⡏⠀⠀⠀⠀⢻⣿⣿⣿⠀ +⣿⣿⣿⣿⠀⠀⠀⣾⣿⡆⣿⠀⠀⠀⣾⣿⡆⣿⣿⣿⡇ +⣿⣿⣿⣿⡄⠀⠀⠙⠛⢱⣿⡄⠀⠀⠙⠛⢱⣿⣿⣿⡇ +⣿⣿⣿⣿⣿⣦⣄⣠⣴⣿⣿⣿⣦⣄⣠⣴⣿⣿⣿⣿⡇ +⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⠀⠀ +⣿⣿⣿⣿⠁⠀⠀⠘⣿⣿⣿⣿⠏⠀⠀⠀⢻⣿⣿⣿⡇⠀⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀ +⠿⣿⡿⠇⠀⠀⠀⠀⠻⣿⣿⠟⠀⠀⠀⠀⠘⢿⣿⡿⠃⠀⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠀