gitmopy.cli =========== .. py:module:: gitmopy.cli .. autoapi-nested-parse:: Command line interface for gitmopy. Module Contents --------------- .. py:function:: catch_keyboard_interrupt(func, *args, **kwargs) Function to wrap another function in a try/finally block and catch Aborts. Executes its first argument with the following arguments and keyword arguments. When the function is done (or has been aborted by ctrl+c), it will prompt the user to restart the commit process or quit. Required because I couldn't find a way to catch typer.Abort exceptions in a standard try/except block. :param func: the function to wrap. :type func: Callable :param \*args: positional arguments to pass to ``func``. :type \*args: Any :param \*\*kwargs: keyword arguments to pass to ``func``. :type \*\*kwargs: Any .. py:function:: commit(repo = '.', add = False, push = None, dry = False, remote = [], keep_alive = False, simple = False, sign = False, no_verify = False) Main command: commit staged files, and staging files if need be. :param repo: Path to the git repository. Defaults to ".". :type repo: str, optional :param add: Whether or not to select unstaged files to add if none is already staged. Defaults to False. :type add: bool, optional :param dry: Whether or not to actually commit. Defaults to False. :type dry: bool, optional :raises typer.Exit: Path to repository is not a Git repository. :raises typer.Exit: No staged files and user does not want to add. :raises typer.Exit: User asked for a dry run. .. py:function:: config() Command to setup gitmopy's configuration. .. py:function:: info() Command to print gitmopy's info. .. py:function:: pull_cli(repo, remote_cli_args) Pull from remotes. If several remotes, use either the values from --remote, or prompt the user to choose them. :param repo: The git repository. :type repo: git.Repo :param remote_cli_args: The remotes passed as CLI arguments. :type remote_cli_args: List[str] :raises typer.Abort: Stops the process if the users does not choose a remote. .. py:function:: push_cli(repo, remote_cli_args) Push to user remotes. If several remotes, use either the values from --remote or prompt the user to select them. :param repo: The git repository. :type repo: Repo :param remote_cli_args: The remotes passed as CLI arguments. :type remote_cli_args: List[str] :raises typer.Abort: If no remote is selected. .. py:function:: should_commit_again(repo, remote) Prompt the user to continue or stop the current commit loop. :param repo: The git repository. :type repo: Repo :returns: Whether the user wants to continue or not. :rtype: bool .. py:function:: start() Runs the commit command with the default arguments you have set in the configuration file. If no such arguments are set, you will be prompted to set them interactively. .. py:data:: app