17
17
You should have received a copy of the GNU General Public License
18
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
20
=====================================
21
bzr bash-completion script and plugin
22
=====================================
20
==========================
21
bzr bash-completion plugin
22
==========================
24
This script generates a shell function which can be used by bash to
24
This plugin generates a shell function which can be used by bash to
25
25
automatically complete the currently typed command when the user
26
26
presses the completion key (usually tab).
39
You only need to do this if you want to use the script as a bzr
40
plugin. Otherwise simply grab the bashcomp.py and place it wherever
43
Installing from bzr repository
44
------------------------------
46
To check out the current code from launchpad, use the following commands::
48
mkdir -p ~/.bazaar/plugins
50
bzr checkout lp:bzr-bash-completion bash_completion
52
To update such an installation, execute this command::
54
bzr update ~/.bazaar/plugins/bash_completion
56
Installing using easy_install
57
-----------------------------
59
The following command should install the latest release of the plugin
62
easy_install bzr-bash-completion
64
To use this method, you need to have `Easy Install`_ installed and
65
also have write access to the required directories. So maybe you
66
should execute this command as root or through sudo_. Or you want to
67
`install to a different location`_.
69
.. _Easy Install: http://peak.telecommunity.com/DevCenter/EasyInstall
70
.. _sudo: http://linux.die.net/man/8/sudo
71
.. _install to a different location:
72
http://peak.telecommunity.com/DevCenter/EasyInstall#non-root-installation
74
Installing from tarball
75
-----------------------
77
If you have grabbed a source code tarball, or want to install from a
78
bzr checkout in a different place than your bazaar plugins directory,
79
then you should use the ``setup.py`` script shipped with the code::
83
If you want to install the plugin only for your own user account, you
84
might wish to pass the option ``--user`` or ``--home=$HOME`` to that
85
command. For further information please read the manuals of distutils_
86
as well as setuptools_ or distribute_, whatever is available on your
87
system, or have a look at the command line help::
89
./setup.py install --help
91
.. _distutils: http://docs.python.org/install/index.html
92
.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools#what-your-users-should-know
93
.. _distribute: http://packages.python.org/distribute/setuptools.html#what-your-users-should-know
35
-------------------------------
36
Bundled and standalone versions
37
-------------------------------
39
This plugin has been merged_ into the main source tree of Bazaar.
40
Starting with the bzr 2.3 series, a common bzr installation will
43
There is still a standalone version available. It makes the plugin
44
available for users of older bzr versions. When using both versions,
45
local configuration might determine which version actually gets used,
46
and some installations might even overwrite one another, so don't use
47
the standalone version if you have the bundled one, unless you know
48
what you are doing. Some effort will be made to keep the two versions
49
reasonably in sync for some time yet.
51
This text here documents the bundled version.
53
.. _merged: http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/revision/5240
114
74
To avoid this problem, you can delay the generation of the completion
115
75
function until you actually need it.
117
To do so, source the file ``lazy.sh`` shipped with this package from
118
your ``~/.bashrc`` file or add it to your ``~/.bash_completion`` if
77
To do so, source the file ``contrib/bash/bzr`` shipped with the bzr
78
source distribution from your ``~/.bashrc`` file
79
or add it to your ``~/.bash_completion`` if
119
80
your setup uses such a file. On a system-wide installation, the
120
81
directory ``/usr/share/bash-completion/`` might contain such bash
121
82
completion scripts.
123
If you installed bzr-bash-completion from the repository or a source
124
tarball, you find the ``lazy.sh`` script in the root of the source
125
tree. If you installed the plugin using easy_install, you should grab
126
the script manually from the bzr repository, e.g. through the bazaar
127
web interface on launchpad.
129
84
Note that the full completion function is generated only once per
130
85
shell session. If you update your bzr installation or change the set
131
86
of installed plugins, then you might wish to regenerate the completion
132
87
function manually as described above in order for completion to take
133
88
these changes into account.
138
As an alternative, if bzrlib is available to python scripts, the
139
following invocation should yield the same results without requiring
140
you to add a plugin::
142
eval "`./bashcomp.py`"
144
This approach might have some issues, though, and provides less
145
options than the bzr plugin. Therefore if you have the choice, go for
152
The plugin (or script) is designed to generate a completion function
94
The plugin is designed to generate a completion function
153
95
containing all the required information about the possible
154
96
completions. This is usually only done once when bash
155
97
initializes. After that, no more invocations of bzr are required. This
166
108
As this is built upon a bash completion script originally included in
167
109
the bzr source tree, and as the bzr sources are covered by the GPL 2,
168
this script here is licensed under these same terms.
110
this plugin here is licensed under these same terms.
170
112
If you require a more liberal license, you'll have to contact all
171
113
those who contributed code to this plugin, be it for bash or for
174
.. cut long_description here