diplomat.utils.cli_tools.extra_cli_args

diplomat.utils.cli_tools.extra_cli_args(config_spec: Dict[str, Tuple[T, TypeCaster[T], str]], auto_cast: bool = True, doc_header: str = 'Additional arguments:') Callable[[Callable], Callable][source]

A decorator for attaching additional CLI arguments to an auto-cli function…

Parameters:
  • config_spec – The additional arguments to attach to the function, using config-spec format.

  • auto_cast – Boolean flag, if true don’t automatically convert extra cli args to their correct types. This means the method needs to do the conversion itself.

  • doc_header – String, the header to use for the extra arguments section in the doc string.

Returns:

A decorator which attaches these arguments to the function, so they are included when turning it into a CLI function…