1.8 KiB
1.8 KiB
cquote TODO
Core functionality (high priority)
-
Implement proper CSV line reader for
random,search, andlist- 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
- Read one record at a time using
-
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
--tagfilter - Simple tabular output or one-per-line
- Optional
-
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
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
--pipeflag for clean output (no extra newlines)- Support multiple database files (-f filename)
deleteorarchivecommand (append to.arclike cnotes)- Integration with
proj:
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