|
|
ace944 |
diff --git a/README.md b/README.md
|
|
|
ace944 |
--- a/README.md
|
|
|
ace944 |
+++ b/README.md
|
|
|
ace944 |
@@ -121,6 +121,31 @@ A. No. Use `M-/` to (in the words of the bash man page) attempt file
|
|
|
ace944 |
A. Put them in `~/.bash_completion`, which is parsed at the end of the
|
|
|
ace944 |
main completion script. See also the next question.
|
|
|
ace944 |
|
|
|
ace944 |
+**Q. How can I override a completion shipped by bash-completion?**
|
|
|
ace944 |
+
|
|
|
ace944 |
+A. Install a local completion of your own appropriately for the desired
|
|
|
ace944 |
+ command, and it will take precedence over the one shipped by us. See the
|
|
|
ace944 |
+ next answer for details where to install it, if you are doing it on per
|
|
|
ace944 |
+ user basis. If you want to do it system wide, you can install eagerly
|
|
|
ace944 |
+ loaded files in `compatdir` (see a couple of questions further down for
|
|
|
ace944 |
+ more info) and install a completion for the commands to override
|
|
|
ace944 |
+ completions shipped by us.
|
|
|
ace944 |
+
|
|
|
ace944 |
+ If you want to use bash's default completion instead of one of ours,
|
|
|
ace944 |
+ something like this should work (where `$cmd` is the command to override
|
|
|
ace944 |
+ completion for): `complete -o default -o bashdefault $cmd`
|
|
|
ace944 |
+
|
|
|
ace944 |
+**Q. Where should I install my own local completions?**
|
|
|
ace944 |
+
|
|
|
ace944 |
+A. Put them in the `completions` subdir of `$BASH_COMPLETION_USER_DIR`
|
|
|
ace944 |
+ (defaults to `$XDG_DATA_HOME/bash-completion` or
|
|
|
ace944 |
+ `~/.local/share/bash-completion`
|
|
|
ace944 |
+ if `$XDG_DATA_HOME` is not set) to have them loaded on demand.
|
|
|
ace944 |
+ See also the next question's answer for considerations for these
|
|
|
ace944 |
+ files' names, they apply here as well. Alternatively, you can write
|
|
|
ace944 |
+ them directly in `~/.bash_completion` which is loaded eagerly by
|
|
|
ace944 |
+ our main script.
|
|
|
ace944 |
+
|
|
|
ace944 |
**Q. I author/maintain package X and would like to maintain my own
|
|
|
ace944 |
completion code for this package. Where should I put it to be sure
|
|
|
ace944 |
that interactive bash shells will find it and source it?**
|