# Day 29 — CLI exit codes and exception integration ## Goal Connect Python exceptions with correct CLI exit codes. ## Tasks - [ ] Learn what process exit codes are - [ ] Learn the difference between exit code 0 and non-zero codes - [ ] Use `sys.exit()` - [ ] Return exit code 0 after successful commands - [ ] Return exit code 1 for general runtime errors - [ ] Return exit code 2 for invalid CLI arguments - [ ] Catch application exceptions in `main()` - [ ] Write errors to stderr - [ ] Test exit codes with `$?` - [ ] Add pytest tests for exit codes - [ ] Update README - [ ] Commit and push changes
Day 29 — CLI exit codes and exception integration
Goal
Connect Python exceptions with correct CLI exit codes.
Tasks
sys.exit()main()$?