Red Hat Bugzilla – Bug 856691
Beaker completion in bash-completion
Last modified: 2016-04-18 06:21:38 EDT
Created attachment 612149 [details]
Description of problem:
This project is an enhancement (Future Feature) for beaker. Its main purpose is to provide more comfort when typing beaker commands.
1. Install bash-completion
2. Download file bkr.bash
3. Move it to /etc/bash_completion.d/ as root
4. Restart terminal
Example of usage:
bkr workflow-tcms --com<TAB><TAB>
bkr workflow-tcms --component
Thanks! I haven't tested it yet but it looks good. I have been thinking for ages that we need a bash completion script.
On Gerrit for review: http://gerrit.beaker-project.org/1359
Verified. But see: https://bugzilla.redhat.com/show_bug.cgi?id=862143
*** Bug 862143 has been marked as a duplicate of this bug. ***
We will need to fix the stderr spew as described by Amit in bug 862143.
Fix is on Gerrit: http://gerrit.beaker-project.org/1395
The bash completion of 'bkr' lists '--password' as an option, bash completion of
'bkr --password' lists the following
[rmancy@rmancy ~]$ bkr --password --
--help --help] --password --username
Notice the '--help]'. Also, none of these completions actually render a sensible command.
This should fix it:
<local opts=$(echo $( bkr $component --help 2>/dev/null | grep -o -- '--[^ =]*' | sort | uniq ) --help )
>local opts=$(echo $( bkr $component --help 2>/dev/null | grep -v "Usage:" | grep -o -- '--[^ =]*' | sort | uniq ) --help )
Beaker 0.9.4 has been released.