62 lines
1.8 KiB
Markdown
62 lines
1.8 KiB
Markdown
|
|
# 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
|
||
|
|
|