Skip to content

Added config option#488

Open
thomas-vinet wants to merge 2 commits intoFlamingTempura:masterfrom
thomas-vinet:config
Open

Added config option#488
thomas-vinet wants to merge 2 commits intoFlamingTempura:masterfrom
thomas-vinet:config

Conversation

@thomas-vinet
Copy link

I've tried to implement, for the CLI, the possibility to give a config file containing an existing set of options as discussed in #411 . It tries to read and parse the file, using yaml structure, then transforms it into a CLI-like list of arguments, which are then reevaluated. Then, it adds it to the arguments, and if there is a collision, it takes the actual arguments passed to the CLI.

The parsing is done in src/cli/configToOptions.ts, and the CLI now calls the added function in src/cli/argsToOptions.ts; the split was done to keep the sync behaviour of the original function, so that all previous tests should pass as usual. I've also added a test file which should cover all the cases I could think of, and that maybe better explains the intended behaviour.

As for now, I've not added this behaviour with the api, nor added the possiblity to export from the web interface a config file, although I would be happy to try to implement this if this could be a nice add. Nested config files (i.e., one config file with an option to read another) are not evaluated.

Let me know if this PR suits the project, or if there are some edge cases that I forgot to consider !

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.

2 participants