────────────────────────────╮ zxws:rlnq:e9ee M README.md │ ────────────────────────────╯ @@ -2,4 +2,7 @@ ─────────────── 2 ┊ 2 │ 3 ┊ 3 │ A tiny note-taking CLI. 4 ┊ 4 │ 5 ┊ │ -Notes are stored in ~/.notes as plain text files. ┊ 5 │ +Notes are stored in `~/.notes`, one plain text file per note. ┊ 6 │ + ┊ 7 │ + notes list ┊ 8 │ + notes search <query> ─────────────────────────────╮ zxws:lwlz:0cb9 M src/cli.js │ ─────────────────────────────╯ @@ -5,3 +5,8 @@ ─────────────── 5 ┊ 5 │ if (cmd === "list") { 6 ┊ 6 │ for (const note of readNotes()) console.log(note.title); 7 ┊ 7 │ } ┊ 8 │ + ┊ 9 │ +if (cmd === "search") { ┊ 10 │ + const matches = readNotes().filter(note => note.title.includes(args[0])); ┊ 11 │ + for (const note of matches) console.log(note.title); ┊ 12 │ +}