diff --git a/python/dune/codegen/options.py b/python/dune/codegen/options.py index 0161d586e4e1f61548c95e59e08b1e19b51ec3ad..48e91fdd51ebde345d1dcefdefa8e99de2c41f77 100644 --- a/python/dune/codegen/options.py +++ b/python/dune/codegen/options.py @@ -129,6 +129,20 @@ _global_options = CodegenGlobalOptionsArray() _form_options = {} +def show_options(): + def subopt(arr): + for k, v in arr.__dict__.items(): + if isinstance(v, CodegenOption) and v.helpstr is not None: + print("{}\n {}".format(k, v.helpstr)) + + print("This is a summary of options available for the code generation process:\n") + print("The following options can be given in the [formcompiler] section:") + subopt(CodegenGlobalOptionsArray) + + print("\nThefollowing options can be given in a form-specific subsection of [formcompiler]:") + subopt(CodegenFormOptionsArray) + + def initialize_options(): """ Initialize the options from the command line """ global _global_options diff --git a/python/setup.py b/python/setup.py index 88431ad1b496afc1c41d13fae5608956274f3018..d847cb90064e734efe22ea0646129fa8bb86be35 100644 --- a/python/setup.py +++ b/python/setup.py @@ -47,5 +47,6 @@ setup(name='dune.codegen', "console_scripts": [ "generate_operators = dune.codegen.compile:entry_generate_operators", "generate_driver = dune.codegen.compile:entry_generate_driver", + "show_options = dune.codegen.options:show_options", ] })