Integrating tab completion
Rainer Müller
raimue at macports.org
Tue Mar 3 08:56:40 PST 2015
On 2015-03-03 15:59, Artur Szostak wrote:
> i.e. under Fedora, one would install an appropriate script under
> /etc/bash_completion.d/ that makes appropriate calls to "complete",
> which registers tab completions for any new commands that your
> package also installs.
>
> What would be the equivalent under the MacPorts system?
First, install the bash-completion port. See this tutorial on how to set
it up:
https://trac.macports.org/wiki/howto/bash-completion
Note that you also need to use bash >= 4.1 from MacPorts as explained in
the wiki page.
Ports providing files for bash-completion should install them to
${prefix}/share/bash-completion/completions/, where the file name
matches the name of the binary (if you have multiple binaries, also
install symlinks). If the completion file was not yet updated for
bash-completion >= 2.0, legacy completion files can still be installed
to ${prefix}/etc/bash_completion.d/.
A few ports still have a +bash_completion variant. Given the fact that
loading times improved a lot with bash_completion >=2.0, I would just
install it unconditionally.
Rainer
More information about the macports-dev
mailing list