Closed sschleemilch closed 1 week ago
Some comments/background information to current design. Some time ago we had something similar, see --format
in for example https://github.com/COVESA/vss-tools/blob/v3.1/docs/vspec2x.md and https://github.com/COVESA/vss-tools/blob/v3.1/vspec2x.py
Some reasons why we changed the setup was:
*2franca.py
files. Could be useful if you want to use vss-tools internally and you for license scanning reasons, vulnerability management or any other reason want to get rid of everything you do not need.With this PR we go back a bit to how it was before, i.e. vspec2x.py
explicitly containing/listing the tools. and it also becomes quite long. I do not know if it would be possible in some way to get a more dynamic design, where each method like def yaml_(
is put in a separate file and not explicitly mentioned in vspec2x.py` to make it easy to add/remove tools.
Good Point, I will investigate a bit whether ITS possible. If not we could keep different entry points like before. Click seems to support lazy subcommand loading: https://click.palletsprojects.com/en/8.1.x/complex/#lazily-loading-subcommands
Will try it out..
Changed it back to previous entry points and left the original positional options like the vspec file and the output file. Changed a few arguments though to be more consistent. So personally the file layout and the cli options are a bit simpler now compared to the vspec2x base class and the config option before. Sure, now every tool cli has to redefine quite a lot cli arguments with the benefit of not needing a config object what a certain exporter supports. Because if the exporter has no cli argument for it, it does simply not support the feature.
MoM: follow up in a week.
Conflicts
I really like this idea and I think even though it might break the current API, we should consider this for the next release (which would have to be 5.0? as it breaks a few things in terms of backwards compatibility, e.g. proplery renaming of the CLAs :grin:)
Edit: Also I would definitely vote for the lazy loading of subcommands
I really like this idea and I think even though it might break the current API, we should consider this for the next release (which would have to be 5.0? as it breaks a few things in terms of backwards compatibility, e.g. proplery renaming of the CLAs 😁)
Edit: Also I would definitely vote for the lazy loading of subcommands
It is now here: #378
About (WIP - builds on top of #371)
Fixes #372
Cli using click