diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 49 |
1 files changed, 41 insertions, 8 deletions
@@ -5,8 +5,22 @@ ## Installation The easiest way to install this software is to use a package; it is -available in many operating system distributions. The package's name -is usually bash-completion. Depending on the package, you may still +available in many operating system distributions, some examples are listed +below. The package's name is usually bash-completion. + +[![Alpine](https://img.shields.io/badge/Alpine-%28see%20website%29-brightgreen.svg)](https://pkgs.alpinelinux.org/packages?name=bash-completion) +[![Arch](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fwww.archlinux.org%2Fpackages%2Fextra%2Fany%2Fbash-completion%2Fjson%2F&query=%24.pkgver&label=Arch)](https://www.archlinux.org/packages/extra/any/bash-completion/) +[![Debian](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapi.ftp-master.debian.org%2Fmadison%3Fpackage%3Dbash-completion%26f%3Djson%26s%3Dunstable&query=%24..source_version&label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1) +[![Fedora](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapps.fedoraproject.org%2Fmdapi%2Frawhide%2Fpkg%2Fbash-completion&query=%24.version&label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion) +[![FreshPorts](https://img.shields.io/badge/FreshPorts-%28see%20website%29-brightgreen.svg)](https://www.freshports.org/shells/bash-completion) +[![Gentoo](https://img.shields.io/badge/Gentoo-%28see%20website%29-brightgreen.svg)](https://packages.gentoo.org/packages/app-shells/bash-completion) +[![Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg)](http://formulae.brew.sh/formula/bash-completion%402) +[![OpenCSW](https://img.shields.io/badge/OpenCSW-%28see%20website%29-brightgreen.svg)](https://www.opencsw.org/package/bash_completion/) +[![openSUSE](https://img.shields.io/badge/openSUSE-%28see%20website%29-brightgreen.svg)](https://software.opensuse.org/package/bash-completion?baseproject=openSUSE%3AFactory) +[![Slackware](https://img.shields.io/badge/Slackware-%28see%20website%29-brightgreen.svg)](https://packages.slackware.com/?search=bash-completion) +[![Ubuntu](https://img.shields.io/badge/Ubuntu-%28see%20website%29-brightgreen.svg)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1) + +Depending on the package, you may still need to source it from either `/etc/bashrc` or `~/.bashrc` (or any other file sourcing those). You can do this by simply using: @@ -26,7 +40,7 @@ standard commands for GNU autotools packages: autoreconf -i # if not installing from prepared release tarball ./configure make -make check # optional, requires dejagnu and tcllib +make check # optional, requires python3 with pytest >= 3.6 and pexpect, dejagnu, and tcllib make install # as root ``` @@ -115,11 +129,30 @@ A. No. Use `M-/` to (in the words of the bash man page) attempt file circumvent any file type restrictions put in place by the bash completion code. -**Q. How can I insert my own local completions without having to - reinsert them every time you issue a new release?** +**Q. How can I override a completion shipped by bash-completion?** -A. Put them in `~/.bash_completion`, which is parsed at the end of the - main completion script. See also the next question. +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 our + completion for in them. + + 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 @@ -283,7 +316,7 @@ A. Probably because the database is being queried every time and this uses a #!/bin/sh rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \ - | sort > /var/log/rpmpkgs + | sort >/var/log/rpmpkgs ``` rpm completion will use this flat text file instead of the RPM database, |