Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 856691

Summary: Beaker completion in bash-completion
Product: [Retired] Beaker Reporter: Filip Holec <fholec>
Component: command lineAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.9CC: asaha, bpeck, dcallagh, kbaker, lzachar, mishin, psplicha, rmancy
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-11 23:49:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
bkr.bash none

Description Filip Holec 2012-09-12 15:15:08 UTC
Created attachment 612149 [details]
bkr.bash

Description of problem:
This project is an enhancement (Future Feature) for beaker. Its main purpose is to provide more comfort when typing beaker commands.

Install:
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 22:16:35 UTC
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 23:36:07 UTC
On Gerrit for review: http://gerrit.beaker-project.org/1359

Comment 4 Amit Saha 2012-10-02 03:25:25 UTC
Verified. But see: https://bugzilla.redhat.com/show_bug.cgi?id=862143

Comment 5 Dan Callaghan 2012-10-02 03:34:05 UTC
*** Bug 862143 has been marked as a duplicate of this bug. ***

Comment 6 Dan Callaghan 2012-10-02 03:34:46 UTC
We will need to fix the stderr spew as described by Amit in bug 862143.

Comment 7 Dan Callaghan 2012-10-02 03:58:03 UTC
Fix is on Gerrit: http://gerrit.beaker-project.org/1395

Comment 10 Raymond Mancy 2012-10-11 06:10:55 UTC
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 07:36:39 UTC
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 23:49:45 UTC
Beaker 0.9.4 has been released.