ENH: Config should allow external override of file locations#460
Open
inkarkat wants to merge 2 commits intotodotxt:masterfrom
Open
ENH: Config should allow external override of file locations#460inkarkat wants to merge 2 commits intotodotxt:masterfrom
inkarkat wants to merge 2 commits intotodotxt:masterfrom
Conversation
E.g. on the command-line: $ TODO_FILE=/path/to/other.txt todo.sh lsc Or through aliases that customize todo.sh for particular todo files: alias todoinbox='TODO_FILE=/path/to/inbox.txt todo.sh' Only non-empty values will override the config default. Cp. todotxt#459
22f691d to
4b273b4
Compare
hyperupcall
reviewed
May 17, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR enables external override of file locations in the todo.txt-cli configuration through environment variables, allowing users to customize TODO_FILE, DONE_FILE, and REPORT_FILE locations via command-line or aliases.
- Modifies the configuration mechanism to use parameter expansion with default values instead of direct assignment
- Updates export statements to allow environment variable overrides while maintaining backward compatibility
- Adds comprehensive test coverage for the new override functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| todo.cfg | Updates configuration to use parameter expansion for overrideable file locations |
| tests/t1050-todofile-override.sh | New test file covering TODO_FILE and DONE_FILE override scenarios |
| tests/t1950-report.sh | Adds test case for REPORT_FILE override functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
karbassi
approved these changes
Oct 3, 2025
Comment on lines
+9
to
+12
| : ${TODO_FILE:="${TODO_DIR}/todo.txt"} | ||
| : ${DONE_FILE:="${TODO_DIR}/done.txt"} | ||
| : ${REPORT_FILE:="${TODO_DIR}/report.txt"} | ||
| export TODO_FILE DONE_FILE REPORT_FILE |
Member
There was a problem hiding this comment.
Never seen this pattern before. Cool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
E.g. on the command-line:
Or through aliases that customize todo.sh for particular todo files:
Only non-empty values will override the config default.
Cp. #459
Before submitting a pull request, please make sure the following is done:
master.Have afixes #XXreference to the issue that this pull request fixes.