Open rasmus-kirk opened 6 months ago
thanks for your contribution, I'll review and test this when I have spare time.
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
20a672a
) 73.15% compared to head (17170bb
) 73.13%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
is it possible to support yaml as well?
is it possible to support yaml as well?
Not really, we can give it a custom parse function, but even if that's doable, the file will still have to have the .json
file extension.
I saw config.txt in this PR
I must be wrong then, well, in that case it should be possible given that we import a yaml parser. If you think yaml support is important I can try adding it later this month. Should we have two flags then, one for each, or what do you think?
I must be wrong then, well, in that case it should be possible given that we import a yaml parser. If you think yaml support is important I can try adding it later this month. Should we have two flags then, one for each, or what do you think?
can't parseFn parse file content by file name ext?
If we add a wrapper function that reads the file extension and applies the correct parsing function accordingly, then yeah I think so. Should be cleaner.
/ping
Adds a config file flag to load in config parameters from a JSON file.
Description
Lets users load in command line configuration files as a JSON file using the
-c
or--config
flags. Options compose, so options set by the command line and the config will combine. If the same option is set by both, the command line value takes precedence. Provided file must be valid JSON and have the.json
file extension. Tested by running with the--config
flag set to a file containing:My use-case is that I'm using nix to configure Flood and providing the secret values for authentication as command line arguments would leak them to the nix store which means non-root users would be able to see the secrets.