Skip to content
Snippets Groups Projects
Commit deaaf7f0 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

[!330] Add a show_options entry point

Merge branch 'feature/show-options-entrypoint' into 'master'

See merge request [extensions/dune-codegen!330]

  [extensions/dune-codegen!330]: Noneextensions/dune-codegen/merge_requests/330
parents 05613378 5477861c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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",
]
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment