From 8e3389d9136be3b69f09a6c05f37fc6df5fc6c76 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Aug 13 2018 14:22:13 +0000 Subject: Document how to turn off default completions Resolves: #1575571 --- diff --git a/bash-completion-2.9-override-completions.patch b/bash-completion-2.9-override-completions.patch new file mode 100644 index 0000000..d0fe758 --- /dev/null +++ b/bash-completion-2.9-override-completions.patch @@ -0,0 +1,35 @@ +diff --git a/README.md b/README.md +--- a/README.md ++++ b/README.md +@@ -121,6 +121,31 @@ A. No. Use `M-/` to (in the words of the bash man page) attempt file + A. Put them in `~/.bash_completion`, which is parsed at the end of the + main completion script. See also the next question. + ++**Q. How can I override a completion shipped by bash-completion?** ++ ++A. Install a local completion of your own appropriately for the desired ++ command, and it will take precedence over the one shipped by us. See the ++ next answer for details where to install it, if you are doing it on per ++ user basis. If you want to do it system wide, you can install eagerly ++ loaded files in `compatdir` (see a couple of questions further down for ++ more info) and install a completion for the commands to override ++ completions shipped by us. ++ ++ If you want to use bash's default completion instead of one of ours, ++ something like this should work (where `$cmd` is the command to override ++ completion for): `complete -o default -o bashdefault $cmd` ++ ++**Q. Where should I install my own local completions?** ++ ++A. Put them in the `completions` subdir of `$BASH_COMPLETION_USER_DIR` ++ (defaults to `$XDG_DATA_HOME/bash-completion` or ++ `~/.local/share/bash-completion` ++ if `$XDG_DATA_HOME` is not set) to have them loaded on demand. ++ See also the next question's answer for considerations for these ++ files' names, they apply here as well. Alternatively, you can write ++ them directly in `~/.bash_completion` which is loaded eagerly by ++ our main script. ++ + **Q. I author/maintain package X and would like to maintain my own + completion code for this package. Where should I put it to be sure + that interactive bash shells will find it and source it?** diff --git a/bash-completion.spec b/bash-completion.spec index 769e9f4..32b2bff 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -5,7 +5,7 @@ Name: bash-completion Version: 2.8 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 1 Summary: Programmable completion for Bash @@ -15,6 +15,9 @@ Source0: https://github.com/scop/bash-completion/releases/download/%{vers # https://bugzilla.redhat.com/677446, see also redefine_filedir comments Patch0: %{name}-1.99-noblacklist.patch +# Remove while rebasing to bash-completion-2.9 +Patch1: %{name}-2.9-override-completions.patch + BuildArch: noarch %if %{with tests} BuildRequires: dejagnu @@ -90,6 +93,10 @@ make -C completions check %changelog +* Mon Aug 13 2018 Siteshwar Vashisht - 1:2.8-3 +- Document how to turn off default completions + Resolves: #1575571 + * Thu Jul 12 2018 Fedora Release Engineering - 1:2.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild