From 64341253a53b3ddaf31bee65a0655f06f969a392 Mon Sep 17 00:00:00 2001 From: Ton Date: Sun, 14 Jun 2026 22:24:25 +0700 Subject: [PATCH] Add count command to print number of notes Co-Authored-By: Claude Sonnet 4.6 --- notes.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/notes.js b/notes.js index df64a18..2f316ef 100644 --- a/notes.js +++ b/notes.js @@ -45,8 +45,13 @@ function main() { console.log(ok ? `Deleted note #${id}` : `No note #${id} found`); break; } + case "count": { + const notes = store.all(); + console.log(`${notes.length} note${notes.length === 1 ? "" : "s"}`); + break; + } default: - console.log("Commands: add | list | search | delete "); + console.log("Commands: add | list | search | delete | count"); console.log(`(Session locks after ${config.SESSION_TIMEOUT_MINUTES} minutes of inactivity.)`); } }