ArgParser Utils (xonsh.cli_utils)
small functions to create argparser CLI from functions.
-
xonsh.cli_utils._from_index_of(container: Sequence[str], key: str)[source]
-
xonsh.cli_utils._get_func_doc(doc: str) → str[source]
-
xonsh.cli_utils._get_param_doc(doc: str, param: str) → str[source]
-
xonsh.cli_utils.dispatch(**ns)[source]
call the sub-command selected by user
-
xonsh.cli_utils.get_doc(func: Callable, parameter: Optional[str] = None)[source]
Parse the function docstring and return its help content
- Parameters
- func
a callable object that holds docstring
- parameter
name of the function parameter to parse doc for
- Returns
- str
doc of the parameter/function
-
xonsh.cli_utils.make_parser(func: Callable, subparser: Optional[argparse._SubParsersAction] = None, params: Optional[Dict[str, Dict[str, Any]]] = None, **kwargs) → argparse.ArgumentParser[source]
A bare-bones argparse builder from functions