inception icon indicating copy to clipboard operation
inception copied to clipboard

Ability to use multiple provider files.

Open pczajkowski opened this issue 5 years ago • 2 comments

This is interesting request (#34), so I've went ahead and implemented it. The only sensible way to do it IMHO is by utilizing flag.Args() and because of that the program should be called with -provider parameter and additional provider JSONs at the end, like./inception -d list -provider provider.json provider2.json provider3.json provider4.json.

I also believe that with multiple files it's better to not crash on read/unmarshalling failure, so I've modified errCheckJSON and added errCheckInfo, so that os.Exit(1) won't be called. But I'm not insisting I'm right here.

It's quite a change and I'm not 100% satisfied with this solution, but at this point I don't see other option.

pczajkowski avatar Jul 13 '20 13:07 pczajkowski

The other option I see would be to pass delimited list of files to -provider, like -provider "provider.json,provider2.json,provider3.json,provider4.json. And then process it using strings.Split. But it's ugly and less user-friendly, I believe.

pczajkowski avatar Jul 13 '20 14:07 pczajkowski

Hi @pczajkowski , Thank you so much for the pull request. I think we should go with first option. I will review and merge.

proabiral avatar Jul 13 '20 16:07 proabiral