uberfastman/fantasy-football-metrics-weekly-report

[Feature Request] CLI parameter to use custom config file

gmattar opened this issue · 5 comments

Description

Include a parameter like -c and --config-file to accept config files with names different than config.ini.

Use case

I have 3 config files config-a.ini config-b.ini config-c.ini for different leagues I'm in. Currently, I've to rename each one to config.ini, run the project, and rename back. It would be good just pass them as parameters.

*Another useful config is -y --yes to bypass any bash confirmation and enable the project to automated execution

@gmattar thanks for the feature request, these are great ideas for the command line options! I agree that allowing the user to specify their own config file would be useful, and will definitely add that flag.

As for bypassing confirmation input prompts, that's not a bad idea, although I'll have to think about which ones to allow bypassing and which ones not. With my latest updates, I do want people to update the app when it is no longer up-to-date, and I do want people to make updates to their config file if it is missing fields, so I might not want to allow those to get breezed through, but we'll see.

In the meantime, if you want to run the report without having it ask about the default week, then you can just make sure to specify the -w <week for report> value as a command line argument. All command line arguments override any settings in the config, so if you specify the week at runtime then it will just run with that week right away. That might make it easier for you to automate running the report for multiple leagues!

That sounds good! thank you

@gmattar I've added the ability to pass a -c (or --config-file) flag followed by the path to your custom config file, and I also added a -a (or --auto-run) flag to automatically run the app using the default week!

Amazing!

👍 @gmattar , just pull the latest from main and you'll be in business! Obviously let me know if you run into any issues, but hopefully those updates should make it easier for you to run the report iteratively for multiple leagues at once.