Bug 856691 - Beaker completion in bash-completion
Beaker completion in bash-completion
Product: Beaker
Classification: Community
Component: command line (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.9.4
: ---
Assigned To: Dan Callaghan
: FutureFeature
: 862143 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2012-09-12 11:15 EDT by Filip Holec
Modified: 2016-04-18 06:21 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-10-11 19:49:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
bkr.bash (1.57 KB, text/plain)
2012-09-12 11:15 EDT, Filip Holec
no flags Details

  None (edit)
Description Filip Holec 2012-09-12 11:15:08 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 wor<TAB><TAB>
bkr workflow-

bkr workflow-t<TAB><TAB>
bkr workflow-tcms

bkr workflow-tcms --com<TAB><TAB>
bkr workflow-tcms --component
Comment 1 Dan Callaghan 2012-09-12 18:16:35 EDT
Thanks! I haven't tested it yet but it looks good. I have been thinking for ages that we need a bash completion script.
Comment 2 Dan Callaghan 2012-09-18 19:36:07 EDT
On Gerrit for review: http://gerrit.beaker-project.org/1359
Comment 4 Amit Saha 2012-10-01 23:25:25 EDT
Verified. But see: https://bugzilla.redhat.com/show_bug.cgi?id=862143
Comment 5 Dan Callaghan 2012-10-01 23:34:05 EDT
*** Bug 862143 has been marked as a duplicate of this bug. ***
Comment 6 Dan Callaghan 2012-10-01 23:34:46 EDT
We will need to fix the stderr spew as described by Amit in bug 862143.
Comment 7 Dan Callaghan 2012-10-01 23:58:03 EDT
Fix is on Gerrit: http://gerrit.beaker-project.org/1395
Comment 10 Raymond Mancy 2012-10-11 02:10:55 EDT
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.
Comment 11 Filip Holec 2012-10-11 03:36:39 EDT
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 )
Comment 12 Dan Callaghan 2012-10-11 19:49:45 EDT
Beaker 0.9.4 has been released.

Note You need to log in before you can comment on or make changes to this bug.