So mark each benchmark with an attribute (or reuse the benchmark-attribute), scan for all benchmarks and match the command line argument that way.
This needs an (abstract) base class.
This way it's easy extendable, and as help this info can be displayed.
The
switch
is always getting bigger: https://github.com/gfoidl/Stochastics/blob/b45c38c1187f5eaa7ae79491c6f1ad6cb0438c61/perf/gfoidl.Stochastics.Benchmarks/Program.cs#L21-L30So mark each benchmark with an attribute (or reuse the benchmark-attribute), scan for all benchmarks and match the command line argument that way. This needs an (abstract) base class.
This way it's easy extendable, and as help this info can be displayed.