From 90b0b5528d23e762e68e83f1757cfa20b58c05c5 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Mon, 30 Mar 2026 23:11:42 +0100 Subject: [PATCH] add todo list for this project --- TODO.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 TODO.md diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..083822a --- /dev/null +++ b/TODO.md @@ -0,0 +1,61 @@ +# cquote TODO + +## Core functionality (high priority) + +- [ ] Implement proper CSV line reader for `random`, `search`, and `list` + - Read one record at a time using `fgets` + - Parse fields with correct unquoting (handle doubled quotes `""`) + - Store quote, author, tags, and date in a struct + +- [ ] Finish `quote_random()` + - Count total quotes + - Pick a random one (using `srand(time(NULL))`) + - Print cleanly (quote on first line, author on second, tags on third) + +- [ ] Implement `quote_search(const char *term)` + - Case-insensitive substring match on quote, author, or tags + - Print matching quotes with context + +- [ ] Implement `quote_list()` + - Optional `--tag` filter + - Simple tabular output or one-per-line + +- [ ] Improve `quote_add()` + - Validate input (non-empty quote and author) + - Normalize tags (lowercase, no duplicates) + - Prevent duplicate quotes (optional) + +## cnotes integration + +- [ ] Create shell alias / wrapper examples + ```bash + alias cnquote='cquote random | cnadd -c Quote' + ``` +- [ ] Document in README how to pipe quotes into daily logs +- [ ] *Optional*: Add a cnotes sub-command like cnotes quote + +## Future / nice-to-have + +- [ ] `--pipe` flag for clean output (no extra newlines) +- [ ] Support multiple database files (-f filename) +- [ ] `delete` or `archive` command (append to `.arc` like cnotes) +- [ ] Integration with `proj`: + +```Bash +proj c mytool --quote # inserts random quote into README +proj c mytool --quote "focus" # uses tagged quote +``` + +## Testing & polish + +- [ ] Add basic test cases (manual or simple shell scripts) +- [ ] Improve error messages and usage text +- [ ] Ensure Windows/DOS compatibility (path handling, line endings) +- [ ] Update README with usage examples and cnotes integration + +## Long-term ideas + +- [ ] Quote-of-the-day daemon / cron suggestion +- [ ] Export to HTML or plain text +- [ ] Fuzzy search +