feat: implement config file (2)#154
Merged
Shinyzenith merged 10 commits intowaycrate:mainfrom Mar 25, 2025
Merged
Conversation
Shinyzenith
previously approved these changes
Mar 24, 2025
Member
|
Things look good to me. The documented toml file is a plus. We should also have a man page section dedicated to the config file. Either that, or we should install the example config in /etc and mention it in man page. |
Member
|
@Decodetalkers can you take a look too? |
Collaborator
Also seems good for me, we can merge it |
Collaborator
Author
|
Hey, @Shinyzenith! I have added the doc file for config (took alacritty's config man for reference), but the doc build fails, could you please look at it? I am not familiar with the format, so I don't really know what's wrong |
Member
|
Sure, I'll take a look |
Signed-off-by: Shinyzenith <aakashsensharma@gmail.com>
Signed-off-by: Shinyzenith <aakashsensharma@gmail.com>
Shinyzenith
approved these changes
Mar 25, 2025
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.
Supersedes #104, closes #97
Most of the stuff, discussed in #104 applied here. We still first take CLI arguments, then config values and only then some defaults to make decisions. Again, by default
config.tomldoes not exist and it's OK to have all options commented out/unset.Default behavior is mostly unchanged, minor non-breaking behavior changes listed below:
cli.log_levelnow is aOption<Level>with fallback valueLevel::Infoin config. No changes from user perspective whatsoevercli.configparameter. Defaults for fallback are also addedcursorandclipboardarefalse(default behavior) -> read values inconfig.toml(defaults for these values arefalseas well, so current users won't notice the difference)stdout,clipboardandFILEdoesn't conflict with each other anymore. Screenshot file will not appear on disk now only if noFILEprovided via args andfileinconfig.tomlisfalseat the same time. In all other cases file is saved, with path following this priority:FILE>config.file.path> current directory. Not breaking, but two category of users affected. First, users currently using-asFILEwill notice that aside fromstdout, there's a screenshot file in current directory (if no config edits were made). Second catogory is users, that did not provideFILEbut provided--clipboardargument: these users will see similar behavior as above