Swapped out function assertions in favour of ArgumentParser

This commit is contained in:
hbristow
2013-08-30 15:06:57 +10:00
parent 8f62a52b9b
commit a780c3a7d1
5 changed files with 67 additions and 12 deletions

View File

@@ -57,6 +57,21 @@
{%- endmacro %}
/*
* composeVariant
* compose a variant call for the ArgumentParser
*/
{% macro composeVariant(fun) %}
addVariant("{{ fun.name }}", {{ fun.req|inputs|length }}, {{ fun.opt|inputs|length }}
{%- if fun.opt|inputs|length %}, {% endif -%}
{%- for arg in fun.opt|inputs -%}
"{{arg.name}}"
{%- if not loop.last %}, {% endif -%}
{% endfor -%}
)
{%- endmacro %}
/*
* composeWithExceptionHandler
* compose a function call wrapped in exception traps