From 2a5b9061fb545f98a52eed34009cfe4f4b47f4c0 Mon Sep 17 00:00:00 2001 From: Jean Jordaan Date: Wed, 28 Apr 2021 13:26:13 +0700 Subject: [PATCH 1/2] Update to match current filename --- etc/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/README.md b/etc/README.md index 677aeda0b..eefa50cbf 100644 --- a/etc/README.md +++ b/etc/README.md @@ -14,8 +14,8 @@ Homebrew programs](https://docs.brew.sh/Shell-Completion). Open your `.bashrc` file if you're on Linux, or your `.bash_profile` if you're on macOS and add: ```sh -if [ -f /path/to/hub.bash_completion ]; then - . /path/to/hub.bash_completion +if [ -f /path/to/hub.bash_completion.sh ]; then + . /path/to/hub.bash_completion.sh fi ``` From 8b8858ed76c1e0849fbfd43b7aeeb631977afdab Mon Sep 17 00:00:00 2001 From: Jean Jordaan Date: Wed, 28 Apr 2021 13:35:03 +0700 Subject: [PATCH 2/2] Note XDG completion convention This enables dynamic loading of `hub` completions. It might also make sense to move the file so that it "just works" with `stow`: 13:39 jean@X1:~/.local/stow/hub-linux-amd64-2.14.2$ mkdir -p share/bash-completion/completions 13:39 jean@X1:~/.local/stow/hub-linux-amd64-2.14.2$ mv etc/hub.bash_completion.sh share/bash-completion/completions/hub.bash 13:41 jean@X1:~/.local/stow$ stow -v hub-linux-amd64-2.14.2 LINK: share/bash-completion => ../stow/hub-linux-amd64-2.14.2/share/bash-completion 13:41 jean@X1:~/.local/stow$ ls ../share/bash-completion/completions/ hub.bash --- etc/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/README.md b/etc/README.md index eefa50cbf..71fe6d968 100644 --- a/etc/README.md +++ b/etc/README.md @@ -19,6 +19,14 @@ if [ -f /path/to/hub.bash_completion.sh ]; then fi ``` +Alternatively, to have completions dynamically loaded +(see the [bash-completion FAQ](https://github.com/scop/bash-completion#faq)): + +```sh +cd ~/.local/share/bash-completion/completions/ +ln -s /path/to/hub.bash_completion.sh hub.bash +``` + ## zsh Copy the file `etc/hub.zsh_completion` from the location where you downloaded