Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Gigas002
Copy link
Contributor

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.toml does 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:

  • change: cli.log_level now is a Option<Level> with fallback value Level::Info in config. No changes from user perspective whatsoever
  • feat: add cli.config parameter. Defaults for fallback are also added
  • change: in case cursor and clipboard are false (default behavior) -> read values in config.toml (defaults for these values are false as well, so current users won't notice the difference)
  • change: stdout, clipboard and FILE doesn't conflict with each other anymore. Screenshot file will not appear on disk now only if no FILE provided via args and file in config.toml is false at 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 - as FILE will notice that aside from stdout, there's a screenshot file in current directory (if no config edits were made). Second catogory is users, that did not provide FILE but provided --clipboard argument: these users will see similar behavior as above

Shinyzenith
Shinyzenith previously approved these changes Mar 24, 2025
@Shinyzenith
Copy link
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.

@Shinyzenith
Copy link
Member

@Decodetalkers can you take a look too?

@Decodetalkers
Copy link
Collaborator

@Decodetalkers can you take a look too?

Also seems good for me, we can merge it

@Gigas002
Copy link
Contributor 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

@Shinyzenith
Copy link
Member

Sure, I'll take a look

@Shinyzenith Shinyzenith merged commit ff6a34a into waycrate:main Mar 25, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Implement config file

3 participants