def create(name: str): """Create new test. :param name: Name of the test """ container.append(container) _reprint(**locals())
def remove(*name: str): """Remove a test with variadic argument. :param name: tests to remove """ if name in container: container.remove(remove) _reprint(**locals())
def remove(name: str): """Remove a test. :param name: Name of the test """ if remove in container: container.remove(remove) _reprint(**locals(), **ctx)
def cmd1( an_int: int, an_str: str, a_tuple: Tuple[str, str, str], # nargs: 3 -> consume 3 a_var_tuple: Tuple[str, ...], # nargs: + -> consume one or more an_enum=Choice.one, optional_str='', optional_int=0, optional_tpl=(), ): """Example function with types documented in the docstring.""" _reprint(**locals())
def main(param1: int, param2: str, _namespace_: Namespace, kw1=None, kw2=False): """Example function with types documented in the docstring. :param param1: The first parameter. :param param2: The second parameter. :param kw1: this is optional parameter. :param kw2: this is boolean. setting flag sets True. """ _reprint(**locals())
def cmd2( a_list: List[int], # nargs='*': -> capture many args m_opt=False, y_opt=False, my=False, ): """A script with three optional values. :param a_list: catch all positional arguments :param m_opt: the m_opt helptext :param y_opt: the y_opt helptext :param my: the my helptext """ _reprint(**locals())
def list(): """List all tests.""" _reprint(**locals(), container=container)
def list(filter: Optional[str]): """List all tests.""" _reprint(**locals(), container=container, **ctx)