Skip to content

Conversation

gitolicious
Copy link
Collaborator

I found a quick way of supporting a config file with fromfile-prefix-chars in the argparse library.
Would have preferred a nicely structured YAML file, but this was a quick win, so I couldn't resist.

Fixes #84.

@gitolicious gitolicious requested a review from rbignon July 19, 2021 19:45
@rbignon
Copy link
Owner

rbignon commented Jul 20, 2021

Hi gitolicious,

To parse from a yaml config file, you can use jsonargparse: https://jsonargparse.readthedocs.io/en/stable/ (see the "Configuration files" section)

@gitolicious
Copy link
Collaborator Author

I actually have a mostly working version with a YAML config file, but merging YAML parameters with the current CLI arguments (especially the unnamed, required ones) in a reasonable way gave me headaches. This one-liner (actually half a line) solution then looked good enough for me as it is perfectly compatible with the current implementation.

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.

Are we getting too many CLI arguments?

2 participants