cowbird.cli =========== .. py:module:: cowbird.cli Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/cowbird/cli/handlers/index /autoapi/cowbird/cli/utils/index Attributes ---------- .. autoapisummary:: cowbird.cli.ParserMaker cowbird.cli.ParserRunner cowbird.cli.LOGGER Functions --------- .. autoapisummary:: cowbird.cli.get_logger_parser cowbird.cli.subparser_help cowbird.cli.get_logger cowbird.cli.main Package Contents ---------------- .. py:data:: ParserMaker .. py:data:: ParserRunner .. py:function:: get_logger_parser() -> argparse.ArgumentParser .. py:function:: subparser_help(description: str, parent_parser: Optional[argparse.ArgumentParser] = None) -> SubParserArgs Generates both fields with the same description as each parameter is used in different context. Field ``help`` is printed next to the subparser name when *parent parser* is called with ``--help``. Field ``description`` populates the help details under the usage command when calling *child parser* ``--help``. .. py:function:: get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) -> logging.Logger Immediately sets the logger level to avoid duplicate log outputs from the `root logger` and `this logger` when `level` is ``logging.NOTSET``. .. py:data:: LOGGER .. py:function:: main(args: Optional[Sequence[str]] = None) -> Optional[int] Automatically groups all sub-helper CLI listed in :py:mod:`cowbird.cli` as a common ``cowbird`` CLI entrypoint. Dispatches the provided arguments to the appropriate sub-helper CLI as requested. Each sub-helper CLI must implement functions ``make_parser`` and ``main`` to generate the arguments and dispatch them to the corresponding caller.