Skip to content

Add unread listing and list-unread CLI#154

Open
pavan-1-cloud wants to merge 3 commits into
github:mainfrom
pavan-1-cloud:add-year-validation
Open

Add unread listing and list-unread CLI#154
pavan-1-cloud wants to merge 3 commits into
github:mainfrom
pavan-1-cloud:add-year-validation

Conversation

@pavan-1-cloud
Copy link
Copy Markdown

Summary

Add support for listing unread books and a CLI command to show them.

This PR implements:

  • BookCollection.get_unread_books(): convenience method returning unread Book objects.
  • book_app: handle_list_unread() and dispatch key list-unread to print only unread books.
  • utils.print_help(): updated help text to include list-unread.
  • Tests: comprehensive pytest cases for get_unread_books and the CLI output.

Files changed

  • samples/book-app-project/books.py
  • samples/book-app-project/book_app.py
  • samples/book-app-project/utils.py
  • samples/book-app-project/tests/test_books.py

Tests

Run:

pytest -q samples/book-app-project/tests/test_books.py

All tests covering unread filtering and CLI behavior were added.

Notes

  • Keeps existing behavior unchanged; added small public API method for clarity.
  • Includes Co-authored-by trailer for automated commits.

pavan-1-cloud and others added 3 commits June 1, 2026 06:10
Add handle_mark and mark command to mark books as read.

Adds CLI help and tests for interactive and argv usage.

Co-authored-by: Copilot <[email protected]>
Add BookCollection.get_unread_books(), handle_list_unread, update help text, and add tests for unread filtering.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant