1 parent 5bac908 commit b48dbe4Copy full SHA for b48dbe4
1 file changed
notes.js
@@ -39,14 +39,21 @@ function main() {
39
}
40
break;
41
42
+ case "edit": {
43
+ const id = Number(rest[0]);
44
+ const text = rest.slice(1).join(" ").trim();
45
+ store.edit(id, text);
46
+ console.log(`Updated note #${id}`);
47
+ break;
48
+ }
49
case "delete": {
50
const id = Number(rest[0]);
51
const ok = store.remove(id);
52
console.log(ok ? `Deleted note #${id}` : `No note #${id} found`);
53
54
55
default:
- console.log("Commands: add <text> | list | search <term> | delete <id>");
56
+ console.log("Commands: add <text> | list | search <term> | edit <id> <text> | delete <id>");
57
console.log(`(Session locks after ${config.SESSION_TIMEOUT_MINUTES} minutes of inactivity.)`);
58
59
0 commit comments