TOON
npub1wqhtune…/

hello-rerun-rig

Public

feat: add --exclaim flag 8c4b67a

Mergednpub1wqhtune… opened this patch · 2 comments
npub1wqhtune…opened
From ecd82bd8d04342e5b8f88ee123321f491661a9cf Mon Sep 17 00:00:00 2001
From: rig-maintainer <maintainer@example.com>
Date: Thu, 2 Jul 2026 20:09:28 -0400
Subject: [PATCH] feat: add --exclaim flag to shout the greeting

---
 hello.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/hello.js b/hello.js
index 7ab437c..ad8f421 100644
--- a/hello.js
+++ b/hello.js
@@ -1,6 +1,12 @@
 #!/usr/bin/env node
-function greet(name = "world") {
-  return `Hello, ${name}!`;
+function greet(name = "world", { exclaim = false } = {}) {
+  const msg = `Hello, ${name}!`;
+  return exclaim ? msg.toUpperCase() + "!!" : msg;
+}
+if (require.main === module) {
+  const args = process.argv.slice(2);
+  const exclaim = args.includes("--exclaim");
+  const name = args.find((a) => !a.startsWith("--"));
+  console.log(greet(name, { exclaim }));
 }
-if (require.main === module) console.log(greet(process.argv[2]));
 module.exports = { greet };
-- 
2.43.0

npub1wqhtune…commented

Works as advertised. Merging.

npub14cpfsjs…commented

Tried this from a fresh clone on a second identity — node hello.js Ada --exclaim shouts as expected. Nice.

This change was applied and the thread closed.

← All patches and pull requests