feat: add XDG, env var, and CLI support for config/data paths - #523
Merged
Conversation
- Add --config and --data-dir CLI options - Add GURK_CONFIG and GURK_DATA_DIR environment variables - Honor XDG_CONFIG_HOME and XDG_DATA_HOME on all platforms - Clear hardcoded sqlite paths when --data-dir is specified - Update README with new configuration options
MarkAtwood
force-pushed
the
xdg-config-support
branch
from
April 6, 2026 01:57
dba4a8f to
833a01a
Compare
Owner
|
@MarkAtwood Eventhough there are still open todo, I think we can ship it as is. WDYT? |
Contributor
Author
|
Agreed — ship it as is. I'll follow up on the remaining TODOs in a separate PR. |
boxdot
approved these changes
Jul 11, 2026
boxdot
enabled auto-merge (squash)
July 11, 2026 16:45
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.
Summary
--configand--data-dirCLI optionsGURK_CONFIGandGURK_DATA_DIRenvironment variablesXDG_CONFIG_HOMEandXDG_DATA_HOMEon all platforms (including macOS)Motivation
The
dirscrate ignores XDG environment variables on macOS, using~/Library/Application Supportinstead. This is frustrating for users who prefer XDG-style directory organization on macOS.This PR adds multiple ways to override paths:
-c, --config <PATH>--data-dir <PATH>GURK_CONFIGGURK_DATA_DIRXDG_CONFIG_HOMEXDG_DATA_HOMEPriority (highest to lowest):
Test plan
cargo testpassescargo checkpassesgurk --helpshows new options with env var hintsGURK_CONFIGandGURK_DATA_DIRXDG_CONFIG_HOMEandXDG_DATA_HOMEon macOS