bw2 / ConfigArgParse

A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables.
MIT License
729 stars 121 forks source link

namespacing based on config? #253

Open duartemolha opened 3 years ago

duartemolha commented 3 years ago

Thank you for your efforts. This library has a lot of what I want, especially the ability to to easily parse a input config file. But was wondering if you could let me know if and how I can accomplish the following scenario.

Assume I have 2 or more datasets I want to process using my software and concatenate them all in the final output

dataset1 would run with parameters set on config1 file dataset2 would run would parameters set on config2 file

command line arguments would be common to both datasets.

is there a way I could accomplish this?

without it I need to run my process in 2 separate instances

parse the arguments from config1 + command line > run process parse arguments from config2 + command line > run process

I am trying to convert a program I created in perl and with that I could use GetOptionsFromArray(\@args,) By parsing the input config files one by one and populating the @args variable and then running the perl equivilent of argparse (getOptions)

bw2 commented 2 years ago

I might be misunderstanding the issue, but can you create a script that you run twice - once for dataset1, and once for dataset2? The 1st run would create the output file, and the 2nd run would concatenate to the output file from run 1?

duartemolha commented 2 years ago

I could but I want to avoid it. This is because my program outputs several text files (that can be relatively easily merged after)

But also a relatively complex excel file that is not so easy to merge and would need to go it manually.

On Wed, 26 Jan 2022, 03:17 bw2, @.***> wrote:

I might be misunderstanding the issue, but can you create a script that you run twice - once for dataset1, and once for dataset2? The 1st run would create the output file, and the 2nd run would concatenate to the output file from run 1?

— Reply to this email directly, view it on GitHub https://github.com/bw2/ConfigArgParse/issues/253#issuecomment-1021824111, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFQIVOTKCFD7UJIUD6IG2LUX5RU3ANCNFSM5GFB7QLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>