Skip to content

fix: make config file parsing stricter and support config includes - #937

Open
matchaxnb wants to merge 1 commit into
moonlight-stream:masterfrom
matchaxnb:feature/reworked-config
Open

fix: make config file parsing stricter and support config includes#937
matchaxnb wants to merge 1 commit into
moonlight-stream:masterfrom
matchaxnb:feature/reworked-config

Conversation

@matchaxnb

Copy link
Copy Markdown

Description
Improve the config parsing and documentation around it.

  • now support comments at the end of lines
  • trims values of their trailing whitespaces
  • refactor error handling in args and config so that all errors are caught at once (alas, uses a global var in the config module, but it's fair ig)
  • safer integer parsing (atoi is known to not care at all for errors)
  • error status is now a bool flag carried around, so parser functions are void ...()
  • update moonlight.conf with a bit of docs to be explicit about parsing format

Purpose

  • ensure config supports the features that are documented as working (like includes)
  • avoid bad types causing issues (like putting a float in the resolution or whatever)

- now support comments at the end of lines
- trims values of their trailing whitespaces
- refactor error handling in args and config so that all errors are
  caught at once (alas, uses a global var in the config module, but
  it's fair ig)
- safer integer parsing (atoi is known to not care at all for errors)
- error status is now a bool flag carried around, so parser functions
  are void ...()
- update moonlight.conf with a bit of docs to be explicit about parsing
  format
@matchaxnb

Copy link
Copy Markdown
Author

Fixes #935

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant