From 87bddef8fdee0cfe9e16b4f1784f471e2aedacc6 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 21 May 2023 14:03:32 -0700 Subject: [PATCH] Documented bash/zsh completion, closes #552 --- docs/installation.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/installation.rst b/docs/installation.rst index f4f132e..c570e6b 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -38,3 +38,27 @@ Using pipx `pipx `__ is a tool for installing Python command-line applications in their own isolated environments. You can use ``pipx`` to install the ``sqlite-utils`` command-line tool like this:: pipx install sqlite-utils + + +.. _cli_completion: + +Setting up shell completion +=========================== + +You can configure shell tab completion for the ``sqlite-utils`` command using these commands. + +For ``bash``: + +.. code-block:: bash + + eval "$(_SQLITE_UTILS_COMPLETE=bash_source sqlite-utils)" + +For ``zsh``: + +.. code-block:: zsh + + eval "$(_SQLITE_UTILS_COMPLETE=zsh_source sqlite-utils)" + +Add this code to ``~/.zshrc`` or ``~/.bashrc`` to automatically run it when you start a new shell. + +See `the Click documentation `__ for more details. \ No newline at end of file