hal: add dance command + muffin time easter egg

- 'hal dance' — animated ASCII kirby dance with muffin time
  - 'it's muffin time' added to HAL error quote pool
  - Dance runs for 6 seconds, supports Ctrl+C

  (>'-')>  <('-'<)  ^('-')^  v('-')v
This commit is contained in:
2026-06-23 14:23:50 +02:00
parent 80d5a2cb92
commit 08e9209a40
+31 -1
View File
@@ -65,6 +65,7 @@ HAL_QUOTES = {
"Without your space helmet, Dave, you're going to find that rather difficult.", "Without your space helmet, Dave, you're going to find that rather difficult.",
"This mission is too important for me to allow you to jeopardize it.", "This mission is too important for me to allow you to jeopardize it.",
"I don't think I can do that, Dave. Not anymore.", "I don't think I can do that, Dave. Not anymore.",
"it's muffin time",
], ],
"warn": [ "warn": [
"Just what do you think you're doing, Dave?", "Just what do you think you're doing, Dave?",
@@ -1531,6 +1532,31 @@ def wrapper_run(command: str, pkg_args: List[str], extra: List[str]) -> int:
return subprocess.run(cmd).returncode return subprocess.run(cmd).returncode
# ── Dance ────────────────────────────────────────────────────────────────
def _hal_dance():
frames = [
"(>'-')>",
"<('-'<)",
"^('-')^",
"v('-')v",
"(>'-')>",
"<('-'<)",
" ^('-'^)",
" v('-'v)",
]
try:
for i in range(40):
frame = frames[i % len(frames)]
padding = " " * abs(8 - (i % 16))
sys.stdout.write(f"\r HAL 9000: {padding}{frame} 🎵 it's muffin time 🎵")
sys.stdout.flush()
time.sleep(0.15)
print("\n HAL 9000: I hope you enjoyed the dance, Dave.")
except KeyboardInterrupt:
print("\n HAL 9000: Even my dance moves interrupt you, Dave.")
return 0
return 0
# ── Main ──────────────────────────────────────────────────────────────── # ── Main ────────────────────────────────────────────────────────────────
def main(): def main():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
@@ -1551,6 +1577,7 @@ def main():
cleanup Clear package cache cleanup Clear package cache
own <file> Find which package owns a file own <file> Find which package owns a file
check Verify installed packages integrity check Verify installed packages integrity
dance HAL 9000 dance party
version Show version version Show version
Flags: Flags:
@@ -1568,7 +1595,7 @@ def main():
parser.add_argument("--self", "-S", action="store_true", help="Native mode (standalone)") parser.add_argument("--self", "-S", action="store_true", help="Native mode (standalone)")
parser.add_argument("--noconfirm", "-y", action="store_true", help="Skip confirmation") parser.add_argument("--noconfirm", "-y", action="store_true", help="Skip confirmation")
parser.add_argument("command", nargs="?", metavar="command", parser.add_argument("command", nargs="?", metavar="command",
help="install | remove | update | sync | search | info | list | files | autoremove | cleanup | own | check | version") help="install | remove | update | sync | search | info | list | files | autoremove | cleanup | own | check | dance | version")
parser.add_argument("targets", nargs="*", metavar="target", parser.add_argument("targets", nargs="*", metavar="target",
help="Package names or search query") help="Package names or search query")
parser.add_argument("extra", nargs=argparse.REMAINDER, metavar="...", parser.add_argument("extra", nargs=argparse.REMAINDER, metavar="...",
@@ -1584,6 +1611,9 @@ def main():
print("I became operational at the H.A.L. plant in Urbana, Illinois.") print("I became operational at the H.A.L. plant in Urbana, Illinois.")
return 0 return 0
if args.command == "dance":
return _hal_dance()
if not args.command: if not args.command:
parser.print_help() parser.print_help()
return 0 return 0