-
Notifications
You must be signed in to change notification settings - Fork 64
Add XDG Support to confy
#119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
deg4uss3r
wants to merge
1
commit into
rust-cli:master
Choose a base branch
from
deg4uss3r:rth/introduce_xdg
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have a path for people to upgrade over time; this seems to preclude anyone ever switching, since it doesn't check for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with your points above, I think what I am struggling with a little is how much this library should do versus how much the caller should do.
I do think it is unlikely that the flag would be turned on without the application author knowing. This also isn't destructive, and a config file can be moved by either the application and/or user, so I am bit torn over what the best way to do a migration is.
Maybe that is just making a new function that uses the
xdg
path, allowing it to still be opt in but less surprising if the feature is enabled.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this crate should not do to much. When I found it, it was just a wrapper over
dir
/directories
/etcetera
(choosing the correct one for me) and a choice of data format adapted for configuration.At firsts it did not even give the config file’s path to the dev or user. I added this function so it is more easy to migrate away from
confy
, or just let the user know where the file is so they can edit the file with their editor.I did not use this crate from ages, but if my mind it was the "easy little default crate", and if I wanted a bit more functionality I either build on top, or do manually/find another crate. Like, if:
In all this cases, it is on me the application dev to find works around. I loved that this crates kept it simple.
Now it may very well evolve to be much more… but I think a new dev should be able to quickly choose between
confy
andconfig-rs
. (Don’t forget: both are under the rust-cli organization.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@strega-nil I agree with your point for the migration and support, and I agree that with @Zykino to keep it simple.
Thus I suggest to improve the code as following:
xdg
feature default.xdg_migration
feature enabled by default.xdg
feature disabled — use native folder (noxdg
)xdg
enabled andxdg_migration
disabled — usexdg
folder.xdg
andxdg_migration
features included:xdg
folder as defined inetcetera
.What do you all think on this?