Any of the programs using the stubs gets any options added to the stubs for free; for example, if you wanted to add support for multiple provers (e.g. Groth16 and GM17) adding a --prover=... option to the stubs could more easily make a different prover available without having to significantly modify the programs which use the stubs.
Ideally, implementing extra program options should try to make all of the main functions cleaner and more consistent with a greater amount of shared code and less duplication, in addition to adding common functionality and making it easier to extend the stub programs with extra options.
See: https://www.boost.org/doc/libs/1_58_0/doc/html/program_options/tutorial.html#idp337609360
If we want to be more idiomatic C++ and use less C-style stuff and enable more complex command-line options, would this be a good improvement?
There are common 'program stubs' which are used as the entry-point for many commands:
Any of the programs using the stubs gets any options added to the stubs for free; for example, if you wanted to add support for multiple provers (e.g. Groth16 and GM17) adding a
--prover=...
option to the stubs could more easily make a different prover available without having to significantly modify the programs which use the stubs.Program entry-points are:
Ideally, implementing extra program options should try to make all of the
main
functions cleaner and more consistent with a greater amount of shared code and less duplication, in addition to adding common functionality and making it easier to extend the stub programs with extra options.