Bash command-line completion scripts
There are two completion scripts available:
ovs-appctl-bashcomp.bash adds bash command-line completion support for
- Display available completion or complete on unfinished user input (long option, subcommand, and argument).
- Subcommand hints
- Convert between keywords like
dpand the available record in ovsdb.
Only supports a small set of important keywords (
Does not support parsing of nested options. For example:
$ ovsdb-tool create [db [schema]]
Does not support expansion on repeated argument. For example:
$ ovs-dpctl show [dp...]).
Only supports matching on long options, and only in the format
--option [arg]. Do not use
ovs-vsctl-bashcomp.bash adds Bash command-line completion support for
- Display available completion and complete on user input for global/local options, command, and argument.
- Query database and expand keywords like
key, to available completions.
- Deal with argument relations like 'one and more', 'zero or one'.
- Complete multiple
ovs-vsctlcommands cascaded via
Completion of very long
ovs-vsctl commands can take up to several seconds.
The bashcomp scripts should be placed at
/etc/bash_completion.d/ to be
available for all bash sessions. Running
make install will place the
$(sysconfdir)/bash_completion.d/, thus, the user should specify
--sysconfdir=/etc at configuration. If OVS is installed from packages, the
scripts will automatically be placed inside
If you just want to run the scripts in one bash, you can remove them from
/etc/bash_completion.d/ and run the scripts via
Unit tests are added in
tests/completion.at and integrated into autotest
framework. To run the tests, just run