HarryR / ethsnarks

A toolkit for viable zk-SNARKS on Ethereum, Web, Mobile and Desktop
GNU Lesser General Public License v3.0
240 stars 57 forks source link

Convert `main()` functions to use `boost::program_options` and/or reduce code duplication in program entry-points. #53

Open HarryR opened 5 years ago

HarryR commented 5 years ago

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.