-
Notifications
You must be signed in to change notification settings - Fork 80
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
Include directives #18
base: master
Are you sure you want to change the base?
Conversation
Also added the ability to use globs (wildcards) in include paths, e.g. |
Hi, thank you for the contribution! Regarding the new directives, having two directives that do almost the same thing doesn't seem great, and I can easily imagine that users are surprised by the #include behavior if they have used similar directives other places. I haven't seen this sort of paradigm in other places, so maybe having a single directive (#include, that requires the file to exist) is sufficient? For a use case where you want to suppose a stock config and the user can provide additional values in a separate file (my assumption for your use case of #include), I would suggest these two workarounds:
Does that sound ok for your use case? Thanks again! |
Ok. I think you are right and that sounds good to me. Let it be only one directive |
@robfig I fixed it. There is only one directive |
Hello,
first of all, thank for the great package. I found it very usefull.
With this PR I would like to introduce the ability to instruct the loader to load additional configuration files and merge them with the main file right from configuration files. Sounds tricky. :)
So the idea is simple and looks like C preprocessor. There are two directives for loading files, e.g.
Of course, you can use
Merge
function for merging multiple files into one but that new feature makes it much easier to maintain multi-file configurations.So that PR should not break any existing code because it does not change the existing syntax and utilizes comments for directives.