setup-completion¶
Added in version 1.0.
rbt setup-completion helps generate scripts that can add auto-completion of RBTools commands to your shell. This allows you to tab-complete RBTools commands. For example:
$ rbt p<tab>
patch post publish
Auto-completion scripts are outputted to the terminal, allowing you to either copy/paste them into your shell configuration or pipe them to a file.
This currently supports Bash and Zsh shells. You can optionally specify either
bash or zsh as a parameter to get the appropriate script. By default,
the correct script for your current shell will be used.
Changed in version 5.0: Previous versions of RBTools attempted to write these scripts to known directories automatically, but that was too error-prone for most configurations.
Usage¶
$ rbt setup-completion [options] <shell>
Installing Completion Scripts¶
Bash¶
Determine where you want your completion script to go.
You have a few options for where to place your auto-completion script.
~/.bashrc~/.local/share/bash-completion/completions/rbt/usr/share/bash-completion/completions/rbt/etc/bash_completion.d/rbt
The correct path depends on your version of Bash, your operating system environment, and your local configuration. If in doubt, you can just place these in
~/.bashrcIf you place it in a completions directory, make sure the file is named
rbt.Generate a script for Bash:
$ rbt setup-completion bash
You can copy/paste from this, or output it directly to the path you prefer.
Restart your shell and type
rbt <tab>to test that it worked.
Zsh¶
Determine where you want your completion script to go.
To see where completion files are stored, run:
$ echo $fpath
You can place the completion file (named
_rbt) in any of these paths.To specify a custom path, add the following to your
~/.zshrc:fpath=(/path/to/completionsdir $fpath)
Make sure auto-completion is enabled for your shell.
Your shell configuration should enable
compinitby including the following line:autoload -U compinit && compinit
If you’re using Oh-My-Zsh, this should be enabled for you.
Generate a script for Zsh:
$ rbt setup-completion zsh
You can copy/paste from this, or output it directly to the path you prefer.
Restart your shell and type
rbt <tab>to test that it worked.
Options¶
- -d, --debug¶
Displays debug output.
This information can be valuable when debugging problems running the command.
The default can be set in
DEBUGin .reviewboardrc.
- --json¶
Output results as JSON data instead of text.
The default can be set in
JSON_OUTPUTin .reviewboardrc.Added in version 3.0.
- --open-browser¶
For commands that navigate you to a URL, this will automatically open a browser to the URL. When used with
--web-login, this will open a browser to the login page.The default can be set in
OPEN_BROWSERin .reviewboardrc.Added in version 6.0.