[feature request] Exclude function (kw)args from synopsis, arguments and flags in help output
eelkevdbos opened this issue · 0 comments
eelkevdbos commented
The help output lists all function (keyword) arguments in the synopsis, arguments and flags.
In my specific use case, I would like to exclude some of those arguments, because they are:
- of non-literal type, and therefore not easily provided through the means of CLI
- injected by a dependency injection decorator
The option to exclude (keyword) arguments could be done in a couple of ways:
- prefix the argument name with an underscore, e.g.
def my_function(a: bool, _complex_type: ComplexType = ComplexType()):
...
- limit args and kwargs to literal types
fire.Fire(help_include_literals_only=True)
- provide the means to exclude arguments based on module or instance type, e.g.
def my_function(a: bool, s: service.ComplexType):
...
fire.Fire(
help_exclude_arg_types=[service.ComplexType],
help_exclude_arg_modules=[service]
)